diff --git a/src/Event/QueryStringCreated.php b/src/Event/QueryStringCreated.php index bdcf021..471d735 100644 --- a/src/Event/QueryStringCreated.php +++ b/src/Event/QueryStringCreated.php @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\ParameterBag; * * This event allows modules to change the facet's query string if needed. */ -class QueryStringCreated extends Event { +final class QueryStringCreated extends Event { const NAME = 'facets.query_string_created'; @@ -21,7 +21,7 @@ class QueryStringCreated extends Event { * * @var \Symfony\Component\HttpFoundation\ParameterBag */ - private $getParameters; + private $queryParameters; /** * The filter parameters. @@ -43,6 +43,7 @@ class QueryStringCreated extends Event { * @var array */ private $activeFilters; + /** * The facet. * @@ -53,7 +54,7 @@ class QueryStringCreated extends Event { /** * QueryStringCreated constructor. * - * @param \Symfony\Component\HttpFoundation\ParameterBag $getParameters + * @param \Symfony\Component\HttpFoundation\ParameterBag $queryParameters * The get parameters to use. * @param array $filterParameters * The filter parameters to use. @@ -64,13 +65,8 @@ class QueryStringCreated extends Event { * @param \Drupal\facets\FacetInterface $facet * The facet. */ - public function __construct(ParameterBag $getParameters, - array $filterParameters, - ResultInterface $facetResult, - array $activeFilters, - FacetInterface $facet - ) { - $this->getParameters = $getParameters; + public function __construct(ParameterBag $queryParameters, array $filterParameters, ResultInterface $facetResult, array $activeFilters, FacetInterface $facet) { + $this->queryParameters = $queryParameters; $this->filterParameters = $filterParameters; $this->facetResult = $facetResult; $this->activeFilters = $activeFilters; @@ -83,8 +79,8 @@ class QueryStringCreated extends Event { * @return \Symfony\Component\HttpFoundation\ParameterBag * The get parameters. */ - public function getGetParameters() { - return $this->getParameters; + public function getQueryParameters() { + return $this->queryParameters; } /** diff --git a/src/Plugin/facets/url_processor/QueryString.php b/src/Plugin/facets/url_processor/QueryString.php index 2de1108..8e5241f 100644 --- a/src/Plugin/facets/url_processor/QueryString.php +++ b/src/Plugin/facets/url_processor/QueryString.php @@ -46,6 +46,9 @@ class QueryString extends UrlProcessorPluginBase { $this->initializeActiveFilters(); } + /** + * {@inheritdoc} + */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, diff --git a/tests/facets_events_test/src/EventListener.php b/tests/facets_events_test/src/EventListener.php index 70c76b8..183f141 100644 --- a/tests/facets_events_test/src/EventListener.php +++ b/tests/facets_events_test/src/EventListener.php @@ -26,7 +26,7 @@ class EventListener implements EventSubscriberInterface { * The query string created event. */ public function queryStringCreated(QueryStringCreated $event) { - $event->getGetParameters()->add(['test' => 'fun']); + $event->getQueryParameters()->add(['test' => 'fun']); } }