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

Coding standards cleanup

parent 88b3b834
......@@ -424,7 +424,7 @@ class DefaultFacetManager {
* @return \Drupal\facets\Result\ResultInterface[]
* 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) {
$current_id = $result->getRawValue();
if (isset($parent_groups[$current_id]) && $parent_groups[$current_id]) {
......
......@@ -469,7 +469,11 @@ class FacetForm extends EntityForm {
'#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
// different stages.
......
......@@ -32,7 +32,7 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor
if ($result->getRawValue() == 0) {
$result->setDisplayValue($config['off_value']);
}
else if ($result->getRawValue() == 1) {
elseif ($result->getRawValue() == 1) {
$result->setDisplayValue($config['on_value']);
}
}
......@@ -84,4 +84,5 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor
'off_value' => 'Off',
];
}
}
......@@ -4,7 +4,6 @@ namespace Drupal\facets\Plugin\facets\widget;
use Drupal\Core\Form\FormStateInterface;
use Drupal\facets\FacetInterface;
use Drupal\facets\Plugin\facets\widget\ArrayWidget;
use Drupal\facets\Plugin\facets\query_type\SearchApiDate;
/**
......
......@@ -41,7 +41,7 @@ interface WidgetPluginInterface extends ConfigurablePluginInterface {
*
* @param string $name
* 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
* The type of the property. Either 'processors' or 'settings'. Another
* value will not be picked up by the widgets.
......
......@@ -2,7 +2,6 @@
namespace Drupal\facets_query_processor\Plugin\facets\url_processor;
use Drupal\Core\Url;
use Drupal\facets\FacetInterface;
use Drupal\facets\UrlProcessor\UrlProcessorPluginBase;
use Symfony\Component\HttpFoundation\Request;
......
......@@ -6,7 +6,6 @@ use Drupal\Component\Utility\Unicode;
use Drupal\Core\Language\LanguageInterface;
use Drupal\search_api\Item\Field;
use Drupal\taxonomy\Entity\Term;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\taxonomy\Tests\TaxonomyTestTrait;
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
......
......@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional;
use Drupal\Core\Url;
use Drupal\facets\Entity\Facet;
use Drupal\views\Entity\View;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the overall functionality of the Facets admin UI.
......
......@@ -5,7 +5,6 @@ namespace Drupal\Tests\facets\Functional;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\search_api\Item\Field;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the processor functionality.
......@@ -164,11 +163,11 @@ class ProcessorIntegrationTest extends FacetsTestBase {
$facet_name = "Boolean";
$facet_id = "boolean";
// Create facet
// Create facet.
$this->editForm = 'admin/config/search/facets/' . $facet_id . '/edit';
$this->createFacet($facet_name, $facet_id, $field_name);
// Check values
// Check values.
$this->drupalGet('search-api-test-fulltext');
$this->assertFacetLabel('1');
......
......@@ -6,7 +6,6 @@ use Drupal\Core\Url;
use Drupal\facets\FacetInterface;
use Drupal\facets\Entity\Facet;
use Drupal\facets\FacetSourceInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Tests the overall functionality of the Facets admin UI.
......
......@@ -91,7 +91,7 @@ class FacetFacetSourceTest extends EntityKernelTestBase {
$this->assertEquals($display_name, $entity->getFacetSourceId());
$this->assertInstanceOf(SearchApiDisplay::class, $entity->getFacetSources()[$display_name]);
$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('f', $entity->getFacetSourceConfig()->getFilterKey());
}
......
......@@ -43,10 +43,10 @@ class SearchApiDateTest extends KernelTestBase {
->getMock();
$widget->method('getConfiguration')
->will($this->returnValue([
'granularity' => $granularity,
'date_display' => '',
'display_relative' => FALSE,
]));
'granularity' => $granularity,
'date_display' => '',
'display_relative' => FALSE,
]));
$widget_instance = $facetReflection->getProperty('widgetInstance');
$widget_instance->setAccessible(TRUE);
$widget_instance->setValue($facet, $widget);
......
......@@ -132,7 +132,7 @@ class FacetSourcePluginManagerTest extends UnitTestCase {
'only id' => ['id' => 'owl'],
'only display_id' => ['display_id' => 'search_api: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 {
'default_enabled' => TRUE,
'stages' => [
"build" => 50,
]
],
]);
$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