Commit 3feb060c authored by borisson_'s avatar borisson_
Browse files

Coding standards cleanup

parent 88b3b834
...@@ -424,7 +424,7 @@ class DefaultFacetManager { ...@@ -424,7 +424,7 @@ class DefaultFacetManager {
* @return \Drupal\facets\Result\ResultInterface[] * @return \Drupal\facets\Result\ResultInterface[]
* An array of results structured hierarchicaly. * An array of results structured hierarchicaly.
*/ */
protected function buildHierarchicalTree($keyed_results, $parent_groups) { protected function buildHierarchicalTree(array $keyed_results, array $parent_groups) {
foreach ($keyed_results as &$result) { foreach ($keyed_results as &$result) {
$current_id = $result->getRawValue(); $current_id = $result->getRawValue();
if (isset($parent_groups[$current_id]) && $parent_groups[$current_id]) { if (isset($parent_groups[$current_id]) && $parent_groups[$current_id]) {
......
...@@ -469,7 +469,11 @@ class FacetForm extends EntityForm { ...@@ -469,7 +469,11 @@ class FacetForm extends EntityForm {
'#collapsed' => TRUE, '#collapsed' => TRUE,
); );
$form['weights']['order'] = ['#markup' => "<h3>" . t('Processor order') . "</h3>"]; $form['weights']['order'] = [
'#markup' => $this->t('Processor order'),
'#prefix' => '<h3>',
'#suffix' => '</h3>',
];
// Order enabled processors per stage, create all the containers for the // Order enabled processors per stage, create all the containers for the
// different stages. // different stages.
......
...@@ -32,7 +32,7 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor ...@@ -32,7 +32,7 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor
if ($result->getRawValue() == 0) { if ($result->getRawValue() == 0) {
$result->setDisplayValue($config['off_value']); $result->setDisplayValue($config['off_value']);
} }
else if ($result->getRawValue() == 1) { elseif ($result->getRawValue() == 1) {
$result->setDisplayValue($config['on_value']); $result->setDisplayValue($config['on_value']);
} }
} }
...@@ -84,4 +84,5 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor ...@@ -84,4 +84,5 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor
'off_value' => 'Off', 'off_value' => 'Off',
]; ];
} }
} }
...@@ -4,7 +4,6 @@ namespace Drupal\facets\Plugin\facets\widget; ...@@ -4,7 +4,6 @@ namespace Drupal\facets\Plugin\facets\widget;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\facets\FacetInterface; use Drupal\facets\FacetInterface;
use Drupal\facets\Plugin\facets\widget\ArrayWidget;
use Drupal\facets\Plugin\facets\query_type\SearchApiDate; use Drupal\facets\Plugin\facets\query_type\SearchApiDate;
/** /**
......
...@@ -41,7 +41,7 @@ interface WidgetPluginInterface extends ConfigurablePluginInterface { ...@@ -41,7 +41,7 @@ interface WidgetPluginInterface extends ConfigurablePluginInterface {
* *
* @param string $name * @param string $name
* The name of the property. Something like * The name of the property. Something like
* 'hide_non_narrowing_result_processor' or 'show_only_one_result' * 'hide_non_narrowing_result_processor' or 'show_only_one_result'.
* @param string $type * @param string $type
* The type of the property. Either 'processors' or 'settings'. Another * The type of the property. Either 'processors' or 'settings'. Another
* value will not be picked up by the widgets. * value will not be picked up by the widgets.
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace Drupal\facets_query_processor\Plugin\facets\url_processor; namespace Drupal\facets_query_processor\Plugin\facets\url_processor;
use Drupal\Core\Url;
use Drupal\facets\FacetInterface; use Drupal\facets\FacetInterface;
use Drupal\facets\UrlProcessor\UrlProcessorPluginBase; use Drupal\facets\UrlProcessor\UrlProcessorPluginBase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
......
...@@ -6,7 +6,6 @@ use Drupal\Component\Utility\Unicode; ...@@ -6,7 +6,6 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageInterface;
use Drupal\search_api\Item\Field; use Drupal\search_api\Item\Field;
use Drupal\taxonomy\Entity\Term; use Drupal\taxonomy\Entity\Term;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\taxonomy\Tests\TaxonomyTestTrait; use Drupal\taxonomy\Tests\TaxonomyTestTrait;
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait; use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
......
...@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional; ...@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\facets\Entity\Facet; use Drupal\facets\Entity\Facet;
use Drupal\views\Entity\View; use Drupal\views\Entity\View;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Tests the overall functionality of the Facets admin UI. * Tests the overall functionality of the Facets admin UI.
......
...@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional; ...@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional;
use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\Entity\FieldStorageConfig;
use Drupal\search_api\Item\Field; use Drupal\search_api\Item\Field;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Tests the processor functionality. * Tests the processor functionality.
...@@ -164,11 +163,11 @@ class ProcessorIntegrationTest extends FacetsTestBase { ...@@ -164,11 +163,11 @@ class ProcessorIntegrationTest extends FacetsTestBase {
$facet_name = "Boolean"; $facet_name = "Boolean";
$facet_id = "boolean"; $facet_id = "boolean";
// Create facet // Create facet.
$this->editForm = 'admin/config/search/facets/' . $facet_id . '/edit'; $this->editForm = 'admin/config/search/facets/' . $facet_id . '/edit';
$this->createFacet($facet_name, $facet_id, $field_name); $this->createFacet($facet_name, $facet_id, $field_name);
// Check values // Check values.
$this->drupalGet('search-api-test-fulltext'); $this->drupalGet('search-api-test-fulltext');
$this->assertFacetLabel('1'); $this->assertFacetLabel('1');
......
...@@ -6,7 +6,6 @@ use Drupal\Core\Url; ...@@ -6,7 +6,6 @@ use Drupal\Core\Url;
use Drupal\facets\FacetInterface; use Drupal\facets\FacetInterface;
use Drupal\facets\Entity\Facet; use Drupal\facets\Entity\Facet;
use Drupal\facets\FacetSourceInterface; use Drupal\facets\FacetSourceInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Tests the overall functionality of the Facets admin UI. * Tests the overall functionality of the Facets admin UI.
......
...@@ -91,7 +91,7 @@ class FacetFacetSourceTest extends EntityKernelTestBase { ...@@ -91,7 +91,7 @@ class FacetFacetSourceTest extends EntityKernelTestBase {
$this->assertEquals($display_name, $entity->getFacetSourceId()); $this->assertEquals($display_name, $entity->getFacetSourceId());
$this->assertInstanceOf(SearchApiDisplay::class, $entity->getFacetSources()[$display_name]); $this->assertInstanceOf(SearchApiDisplay::class, $entity->getFacetSources()[$display_name]);
$this->assertInstanceOf(SearchApiDisplay::class, $entity->getFacetSource()); $this->assertInstanceOf(SearchApiDisplay::class, $entity->getFacetSource());
$this->assertInstanceOf(FacetSourceInterface::class , $entity->getFacetSourceConfig()); $this->assertInstanceOf(FacetSourceInterface::class, $entity->getFacetSourceConfig());
$this->assertEquals($display_name, $entity->getFacetSourceConfig()->getName()); $this->assertEquals($display_name, $entity->getFacetSourceConfig()->getName());
$this->assertEquals('f', $entity->getFacetSourceConfig()->getFilterKey()); $this->assertEquals('f', $entity->getFacetSourceConfig()->getFilterKey());
} }
......
...@@ -132,7 +132,7 @@ class FacetSourcePluginManagerTest extends UnitTestCase { ...@@ -132,7 +132,7 @@ class FacetSourcePluginManagerTest extends UnitTestCase {
'only id' => ['id' => 'owl'], 'only id' => ['id' => 'owl'],
'only display_id' => ['display_id' => 'search_api:owl'], 'only display_id' => ['display_id' => 'search_api:owl'],
'only label' => ['label' => 'Owl'], 'only label' => ['label' => 'Owl'],
'no label' => ['id' => 'owl', 'display_id' => 'Owl'] 'no label' => ['id' => 'owl', 'display_id' => 'Owl'],
]; ];
} }
......
...@@ -56,7 +56,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase { ...@@ -56,7 +56,7 @@ class ExcludeSpecifiedItemsProcessorTest extends UnitTestCase {
'default_enabled' => TRUE, 'default_enabled' => TRUE,
'stages' => [ 'stages' => [
"build" => 50, "build" => 50,
] ],
]); ]);
$processor_definitions = [ $processor_definitions = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment