Commit e510c8ec authored by borisson_'s avatar borisson_ Committed by borisson_

Issue #2914506 by borisson_: Fix coding standards things

parent 59062708
......@@ -88,7 +88,9 @@ function facets_update_8002() {
/**
* WARNING: Facets core search support has been moved into a separate project.
* If you are using this feature, you need do download the "facets_core_search" module on drupal.org."
*
* If you are using this feature, you need do download the "facets_core_search"
* module from drupal.org."
*/
function facets_update_8003() {
\Drupal::database()->delete('key_value')
......@@ -110,7 +112,7 @@ function facets_update_8004() {
$settings = [
'date_format' => $widget['config']['date_display'],
'granularity' => $widget['config']['granularity'],
'date_display' => 'actual_date'
'date_display' => 'actual_date',
];
if ($widget['config']['display_relative']) {
$settings['date_display'] = 'relative_date';
......
......@@ -56,7 +56,7 @@ class ShowSummaryProcessor extends ProcessorPluginBase implements BuildProcessor
* @return \Drupal\facets\Result\ResultInterface[]
* The active results found.
*/
protected function getActiveDisplayValues($results) {
protected function getActiveDisplayValues(array $results) {
$items = [];
foreach ($results as $result) {
if ($result->isActive()) {
......@@ -68,4 +68,5 @@ class ShowSummaryProcessor extends ProcessorPluginBase implements BuildProcessor
}
return $items;
}
}
......@@ -196,7 +196,7 @@ class IntegrationTest extends FacetsTestBase {
'facets[giraffe][label]' => 'Summary giraffe',
'facets[llama][checked]' => TRUE,
'facets[llama][label]' => 'Summary llama',
'facets_summary_settings[show_summary][status]' => TRUE
'facets_summary_settings[show_summary][status]' => TRUE,
];
$this->drupalPostForm(NULL, $summaries, 'Save');
......
......@@ -94,7 +94,6 @@ interface FacetInterface extends ConfigEntityInterface {
/**
* Returns the field name of the facet as used in the index.
*
*
* @return string
* The name of the facet.
*/
......
......@@ -7,6 +7,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Link;
use Drupal\Component\Utility\Html;
use Drupal\Core\Url;
use Drupal\facets_summary\Entity\FacetsSummary;
use Drupal\facets_summary\FacetsSummaryInterface;
......@@ -293,8 +294,8 @@ class FacetListBuilder extends DraggableListBuilder {
foreach ($groups['lone_facets'] as $i => $facet) {
// Facets core search moved into a separate project. Show a clean
// message to notify users how to resolve their broken facets.
if (substr($facet->getFacetSourceId(), 0, 16) == 'core_node_search'){
$project_link = Link::fromTextAndUrl('https://www.drupal.org/project/facets_core_search', \Drupal\Core\Url::fromUri('https://www.drupal.org/project/facets_core_search'))->toString();
if (substr($facet->getFacetSourceId(), 0, 16) == 'core_node_search') {
$project_link = Link::fromTextAndUrl('https://www.drupal.org/project/facets_core_search', Url::fromUri('https://www.drupal.org/project/facets_core_search'))->toString();
drupal_set_message(t('Core search facets has been moved to a separate project. You need to download and enable this module from @project_link to continue using your core search facets.', ['@project_link' => $project_link]), 'error');
}
$form['facets'][$facet->id()] = $this->buildRow($facet);
......
......@@ -27,9 +27,9 @@ class FacetSourceEditForm extends EntityForm {
protected $urlProcessorPluginManager;
/**
* The UUID generator interface
* The UUID generator interface.
*
* @var \Drupal\facets\Form\UuidInterface
* @var \Drupal\Component\Uuid\UuidInterface
*/
protected $uuid;
......@@ -82,7 +82,7 @@ class FacetSourceEditForm extends EntityForm {
'id' => $source_id,
'name' => $this->getRequest()->get('facets_facet_source'),
'is_new' => TRUE,
'uuid' => $this->uuid->generate()
'uuid' => $this->uuid->generate(),
],
'facets_facet_source'
);
......
......@@ -79,7 +79,7 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
$facet = $this->facetStorage->load($facet_id);
// No need to build the facet if it does not need to be visible.
if($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()){
if ($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()) {
return;
}
......
......@@ -2,7 +2,6 @@
namespace Drupal\facets\Plugin\facets\processor;
use Drupal\Core\TypedData\DataDefinitionInterface;
use Drupal\facets\FacetInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\facets\Processor\BuildProcessorInterface;
......@@ -94,7 +93,8 @@ class BooleanItemProcessor extends ProcessorPluginBase implements BuildProcessor
foreach ($property_definitions as $k => $definition) {
if ($definition->getDataType() == "boolean") {
return TRUE;
}};
}
}
return FALSE;
}
......
......@@ -145,7 +145,8 @@ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProce
foreach ($property_definitions as $k => $definition) {
if ($definition instanceof DataReferenceDefinitionInterface && $definition->getDataType() === 'entity_reference') {
return TRUE;
}};
}
}
return FALSE;
}
......
......@@ -53,7 +53,8 @@ class UidToUserNameCallbackProcessor extends ProcessorPluginBase implements Buil
$definition->getTargetDefinition()->getConstraint('EntityType') === "user"
) {
return TRUE;
}};
}
}
return FALSE;
}
......
......@@ -160,7 +160,11 @@ class FacetFacetSourceTest extends EntityKernelTestBase {
$entity->setWidget('links');
$entity->setFacetSourceId('search_api:views_page__search_api_test_view__page_1');
$entity->setFieldIdentifier('name');
$entity->addProcessor(['processor_id' => 'invalid_qt', 'weights' => [], 'settings' => []]);
$entity->addProcessor([
'processor_id' => 'invalid_qt',
'weights' => [],
'settings' => [],
]);
$this->setExpectedException(InvalidQueryTypeException::class);
$entity->getQueryType();
......
......@@ -63,7 +63,11 @@ class SearchApiDateTest extends KernelTestBase {
$facet->addProcessor([
'processor_id' => 'date_item',
'weights' => [],
'settings' => ['granularity' => $granularity, 'date_format' => '', 'date_display' => 'actual_date'],
'settings' => [
'granularity' => $granularity,
'date_format' => '',
'date_display' => 'actual_date',
],
]);
$query_type = new SearchApiDate(
......@@ -279,7 +283,11 @@ class SearchApiDateTest extends KernelTestBase {
$facet->addProcessor([
'processor_id' => 'date_item',
'weights' => [],
'settings' => ['granularity' => SearchApiDate::FACETAPI_DATE_YEAR, 'date_format' => '', 'date_display' => 'actual_date'],
'settings' => [
'granularity' => SearchApiDate::FACETAPI_DATE_YEAR,
'date_format' => '',
'date_display' => 'actual_date',
],
]);
$query_type = new SearchApiDate(
......
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