Commit 6da4a0fd authored by Tim Diels's avatar Tim Diels Committed by Markus Kalkbrenner
Browse files

Issue #3255596: Fix coding standards

parent 86c27cd6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ CONTENTS OF THIS FILE
INTRODUCTION
------------

The Facets module allows site builders to easily create and manage faceted search
interfaces.
The Facets module allows site builders to easily create and manage faceted
search interfaces.


REQUIREMENTS
+3 −5
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
@@ -235,7 +234,7 @@ function facets_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInter
  }

  foreach ($facet_sources_definitions as $definition) {
    /* @var \Drupal\facets\FacetSource\FacetSourcePluginBase $facet_source_plugin */
    /** @var \Drupal\facets\FacetSource\FacetSourcePluginBase $facet_source_plugin */
    $facetsource_id = $definition['id'];
    $facet_source_plugin = $facet_source_manager->createInstance($facetsource_id);

@@ -298,11 +297,11 @@ function facets_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMatchInter
      }
    }

    // TODO find a better way to construct the url for a crumb maybe url
    // @todo find a better way to construct the url for a crumb maybe url
    // processor will have a function to get params for a result
    // without all the other request parameters; with this we could implement:
    // @see https://www.drupal.org/node/2861586
    // TODO handle not grouped facets.
    // @todo handle not grouped facets.
    /** @var \Drupal\facets\Result\ResultInterface[] $facet_results */
    foreach ($active_results as $facet_id => $facet_results) {
      $facet_used_result[$facet_id] = [];
@@ -340,7 +339,6 @@ function facets_language_switch_links_alter(array &$links, $type, Url $url) {
  $alterer->alter($links, $type, $url);
}


/**
 * Implements hook_form_FORM_ID_alter().
 */
+4 −1
Original line number Diff line number Diff line
@@ -36,7 +36,10 @@ class RangeSliderWidget extends SliderWidget {

    $min = $facet_settings['min'];
    $max = $facet_settings['max'];
    $facet_settings['values'] = [isset($active[0][0]) ? (float) $active[0][0] : $min, isset($active[0][1]) ? (float) $active[0][1] : $max];
    $facet_settings['values'] = [
      isset($active[0][0]) ? (float) $active[0][0] : $min,
      isset($active[0][1]) ? (float) $active[0][1] : $max,
    ];

    return $build;
  }
+4 −4
Original line number Diff line number Diff line
@@ -112,12 +112,12 @@ class FacetsSerializer extends Serializer {
    $facets_metadata = [];
    foreach ($facets as $facet) {
      $processed_facets[] = $this->facetsManager->build($facet);
      $facets_metadata[$facet->id()] = array(
      $facets_metadata[$facet->id()] = [
        'label' => $facet->label(),
        'weight' => $facet->getWeight(),
        'field_id' => $facet->getFieldIdentifier(),
        'url_alias' => $facet->getUrlAlias()
      );
        'url_alias' => $facet->getUrlAlias(),
      ];
    }
    uasort($facets_metadata, function ($a, $b) {
      return (int) $a['weight'] - $b['weight'];
Loading