Skip to content
Snippets Groups Projects

Fix PHPCS issues.

Open Hervé Donner requested to merge issue/facets-3502922:3502922-fix-phpcs-issues into 3.0.x
1 unresolved thread
23 files
+ 113
59
Compare changes
  • Side-by-side
  • Inline
Files
23
@@ -11,7 +11,6 @@ use Drupal\facets\FacetInterface;
use Drupal\facets\Hierarchy\HierarchyPluginBase;
use Drupal\facets\Processor\ProcessorInterface;
use Drupal\facets\Processor\SortProcessorInterface;
use Drupal\facets\Result\Result;
use Drupal\views\Plugin\views\filter\FilterPluginBase;
/**
@@ -26,11 +25,15 @@ class FacetsFilter extends FilterPluginBase {
/**
* {@inheritdoc}
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $no_operator = FALSE;
/**
* Will be filled with the facet results after the query is executed.
* Stores the facet results after the query is executed.
*
* @var \Drupal\facets\Result\ResultInterface[]
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public $facet_results = [];
/**
@@ -103,7 +106,7 @@ class FacetsFilter extends FilterPluginBase {
return $form;
}
// Retrieve the processed facet if we already done this in the current request.
// Retrieve the processed facet if already handled in the current request.
$processed_facet = facets_exposed_filters_get_processed_facet($this->view->id(), $this->view->current_display, $this->options["id"]);
// Empty facet results, return empty form.
@@ -134,8 +137,8 @@ class FacetsFilter extends FilterPluginBase {
);
$query_type_plugin->build();
// When no results are available, we do not need to process the facet or render the form item.
if(!$facet->getResults()) {
// Skip facet processing and form rendering if there are no results.
if (!$facet->getResults()) {
return;
}
@@ -151,7 +154,7 @@ class FacetsFilter extends FilterPluginBase {
$facet->setResults($processor->build($facet, $facet->getResults()));
}
// Trigger sort stage and sort the actual results with the sort processors.
// Allow processors to sort the results.
$active_sort_processors = [];
foreach ($facet->getProcessorsByStage(ProcessorInterface::STAGE_SORT) as $processor) {
$active_sort_processors[] = $processor;
@@ -161,7 +164,8 @@ class FacetsFilter extends FilterPluginBase {
}
$facet->setActiveItems(array_values($active_facet_values));
// Store the processed facet so we can access it later (e.g. in an exposed form rendered as a block).
// Store the processed facet so we can access it later (e.g. in an exposed
// form rendered as a block).
facets_exposed_filters_get_processed_facet($this->view->id(), $this->view->current_display, $this->options["id"], $facet);
}
@@ -548,8 +552,9 @@ class FacetsFilter extends FilterPluginBase {
* to retrieve the active filters from the request ourself.
*/
private function getActiveFacetValues() {
// Reset button in ajax request. We probably want a better way to detect if this was clicked.
if(isset($_GET["reset"])) {
// Reset button in ajax request. We probably want a better way to detect if
// this was clicked.
if (isset($_GET["reset"])) {
return [];
}
$exposed = $this->view->getExposedInput();
Loading