summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-10-13 17:43:15 (GMT)
committerxjm2017-10-13 17:43:15 (GMT)
commitdb5e8289f23fc038a7465a3a43d3a520dcc1d73c (patch)
tree0396f96014df58461a39703578466dca7f0adf0c
parent2fc85e7f0fadc299e303134e569d0e9c144ee282 (diff)
Issue #2572787 by alexpott, mfernea, attiks, andriyun, andypost, RoSk0, hussainweb, klausi, martin107: Fix 'Drupal.WhiteSpace.CloseBracketSpacing' coding standard
-rw-r--r--core/lib/Drupal/Core/Config/Entity/Query/Condition.php2
-rw-r--r--core/lib/Drupal/Core/Config/InstallStorage.php2
-rw-r--r--core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php4
-rw-r--r--core/lib/Drupal/Core/Diff/DiffFormatter.php2
-rw-r--r--core/lib/Drupal/Core/Entity/EntityType.php2
-rw-r--r--core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php2
-rw-r--r--core/lib/Drupal/Core/Update/UpdateRegistry.php2
-rw-r--r--core/modules/action/tests/src/Functional/ActionUninstallTest.php2
-rw-r--r--core/modules/block/src/BlockAccessControlHandler.php2
-rw-r--r--core/modules/config_translation/src/FormElement/Textarea.php2
-rw-r--r--core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php2
-rw-r--r--core/modules/hal/tests/src/Kernel/DenormalizeTest.php2
-rw-r--r--core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php2
-rw-r--r--core/modules/image/src/Tests/QuickEditImageControllerTest.php2
-rw-r--r--core/modules/language/src/Form/NegotiationBrowserForm.php2
-rw-r--r--core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php2
-rw-r--r--core/modules/node/src/NodeGrantDatabaseStorage.php2
-rw-r--r--core/modules/node/tests/src/Functional/NodeCreationTest.php2
-rw-r--r--core/modules/search/src/SearchQuery.php2
-rw-r--r--core/modules/simpletest/src/Tests/SimpleTestTest.php2
-rw-r--r--core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php2
-rw-r--r--core/modules/system/src/Tests/Module/InstallUninstallTest.php2
-rw-r--r--core/modules/system/system.install4
-rw-r--r--core/modules/system/system.module2
-rw-r--r--core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php2
-rw-r--r--core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php2
-rw-r--r--core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php2
-rw-r--r--core/modules/toolbar/toolbar.api.php2
-rw-r--r--core/modules/toolbar/toolbar.module2
-rw-r--r--core/modules/user/src/Tests/UserRegistrationTest.php2
-rw-r--r--core/modules/views/src/Plugin/views/argument/MonthDate.php2
-rw-r--r--core/modules/views/src/Plugin/views/field/FieldPluginBase.php4
-rw-r--r--core/modules/views/src/Plugin/views/row/EntityReference.php2
-rw-r--r--core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php2
-rw-r--r--core/modules/views_ui/src/ViewEditForm.php2
-rw-r--r--core/phpcs.xml.dist1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php12
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php6
40 files changed, 50 insertions, 49 deletions
diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Condition.php b/core/lib/Drupal/Core/Config/Entity/Query/Condition.php
index 23971ea..bd2facd 100644
--- a/core/lib/Drupal/Core/Config/Entity/Query/Condition.php
+++ b/core/lib/Drupal/Core/Config/Entity/Query/Condition.php
@@ -50,7 +50,7 @@ class Condition extends ConditionBase {
// matter and this config object does not match.
// If OR and it is matching, then the rest of conditions do not
// matter and this config object does match.
- if ($and != $match ) {
+ if ($and != $match) {
break;
}
}
diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php
index 9fea3df..c8d189e 100644
--- a/core/lib/Drupal/Core/Config/InstallStorage.php
+++ b/core/lib/Drupal/Core/Config/InstallStorage.php
@@ -133,7 +133,7 @@ class InstallStorage extends FileStorage {
else {
$return = [];
foreach ($names as $index => $name) {
- if (strpos($name, $prefix) === 0 ) {
+ if (strpos($name, $prefix) === 0) {
$return[$index] = $names[$index];
}
}
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
index c9eb3f8..70d9a33 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
@@ -254,7 +254,7 @@ class Tasks extends InstallTasks {
\'SELECT random();\'
LANGUAGE \'sql\'',
[],
- ['allow_delimiter_in_query' => TRUE ]
+ ['allow_delimiter_in_query' => TRUE]
);
}
@@ -263,7 +263,7 @@ class Tasks extends InstallTasks {
\'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
LANGUAGE \'sql\'',
[],
- ['allow_delimiter_in_query' => TRUE ]
+ ['allow_delimiter_in_query' => TRUE]
);
}
$connection->query('SELECT pg_advisory_unlock(1)');
diff --git a/core/lib/Drupal/Core/Diff/DiffFormatter.php b/core/lib/Drupal/Core/Diff/DiffFormatter.php
index 0c17ce2..d6c9cb6 100644
--- a/core/lib/Drupal/Core/Diff/DiffFormatter.php
+++ b/core/lib/Drupal/Core/Diff/DiffFormatter.php
@@ -192,7 +192,7 @@ class DiffFormatter extends DiffFormatterBase {
// Notice that WordLevelDiff returns HTML-escaped output. Hence, we will be
// calling addedLine/deletedLine without HTML-escaping.
while ($line = array_shift($del)) {
- $aline = array_shift($add );
+ $aline = array_shift($add);
$this->rows[] = array_merge($this->deletedLine($line), isset($aline) ? $this->addedLine($aline) : $this->emptyLine());
}
diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php
index 5f6589a..9584ed3 100644
--- a/core/lib/Drupal/Core/Entity/EntityType.php
+++ b/core/lib/Drupal/Core/Entity/EntityType.php
@@ -313,7 +313,7 @@ class EntityType extends PluginDefinition implements EntityTypeInterface {
// Automatically add the EntityChanged constraint if the entity type tracks
// the changed time.
- if ($this->entityClassImplements(EntityChangedInterface::class) ) {
+ if ($this->entityClassImplements(EntityChangedInterface::class)) {
$this->addConstraint('EntityChanged');
}
diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
index bd5a710..db194b5 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
@@ -46,7 +46,7 @@ class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexData
public static function createFromEntity(EntityInterface $entity) {
$definition = EntityDataDefinition::create()
->setEntityTypeId($entity->getEntityTypeId())
- ->setBundles([$entity->bundle() ]);
+ ->setBundles([$entity->bundle()]);
$instance = new static($definition);
$instance->setValue($entity);
return $instance;
diff --git a/core/lib/Drupal/Core/Update/UpdateRegistry.php b/core/lib/Drupal/Core/Update/UpdateRegistry.php
index b24ac67..a4e0081 100644
--- a/core/lib/Drupal/Core/Update/UpdateRegistry.php
+++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php
@@ -226,7 +226,7 @@ class UpdateRegistry {
$all_functions = $this->getAvailableUpdateFunctions();
return array_filter($all_functions, function ($function_name) use ($module_name) {
- list($function_module_name, ) = explode("_{$this->updateType}_", $function_name);
+ list($function_module_name,) = explode("_{$this->updateType}_", $function_name);
return $function_module_name === $module_name;
});
}
diff --git a/core/modules/action/tests/src/Functional/ActionUninstallTest.php b/core/modules/action/tests/src/Functional/ActionUninstallTest.php
index 6b52643..5b01099 100644
--- a/core/modules/action/tests/src/Functional/ActionUninstallTest.php
+++ b/core/modules/action/tests/src/Functional/ActionUninstallTest.php
@@ -27,7 +27,7 @@ class ActionUninstallTest extends BrowserTestBase {
$storage = $this->container->get('entity_type.manager')->getStorage('action');
$storage->resetCache(['user_block_user_action']);
- $this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.' );
+ $this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.');
$admin_user = $this->drupalCreateUser(['administer users']);
$this->drupalLogin($admin_user);
diff --git a/core/modules/block/src/BlockAccessControlHandler.php b/core/modules/block/src/BlockAccessControlHandler.php
index 176c326..35af61e 100644
--- a/core/modules/block/src/BlockAccessControlHandler.php
+++ b/core/modules/block/src/BlockAccessControlHandler.php
@@ -61,7 +61,7 @@ class BlockAccessControlHandler extends EntityAccessControlHandler implements En
* @param \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository
* The lazy context repository service.
*/
- public function __construct(EntityTypeInterface $entity_type, ContextHandlerInterface $context_handler, ContextRepositoryInterface $context_repository ) {
+ public function __construct(EntityTypeInterface $entity_type, ContextHandlerInterface $context_handler, ContextRepositoryInterface $context_repository) {
parent::__construct($entity_type);
$this->contextHandler = $context_handler;
$this->contextRepository = $context_repository;
diff --git a/core/modules/config_translation/src/FormElement/Textarea.php b/core/modules/config_translation/src/FormElement/Textarea.php
index ff9e4cd..4308969 100644
--- a/core/modules/config_translation/src/FormElement/Textarea.php
+++ b/core/modules/config_translation/src/FormElement/Textarea.php
@@ -15,7 +15,7 @@ class Textarea extends FormElementBase {
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
// Estimate a comfortable size of the input textarea.
$rows_words = ceil(str_word_count($translation_config) / 5);
- $rows_newlines = substr_count($translation_config, "\n" ) + 1;
+ $rows_newlines = substr_count($translation_config, "\n") + 1;
$rows = max($rows_words, $rows_newlines);
return [
diff --git a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
index dfc50f2..a24bedb 100644
--- a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php
@@ -347,7 +347,7 @@ class FieldStorageCrudTest extends FieldKernelTestBase {
FieldConfig::create($field_definition)->save();
$field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']);
$this->assertTrue(!empty($field_storage) && !$field_storage->isDeleted(), 'A new storage with a previously used name is created.');
- $field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] );
+ $field = FieldConfig::load('entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name']);
$this->assertTrue(!empty($field) && !$field->isDeleted(), 'A new field for a previously used field name is created.');
// Save an entity with data for the field
diff --git a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
index bed2ff6..87eb973 100644
--- a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
+++ b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
@@ -135,7 +135,7 @@ class DenormalizeTest extends NormalizerTestBase {
],
'field_test_text' => [],
];
- $entity = $this->serializer->denormalize($data, get_class($entity), $this->format, ['target_instance' => $entity ]);
+ $entity = $this->serializer->denormalize($data, get_class($entity), $this->format, ['target_instance' => $entity]);
$this->assertEqual($entity->field_test_text->count(), 0);
}
diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
index 8296601..baa4e7f 100644
--- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
@@ -193,7 +193,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
$this->drupalGet($generate_url_noaccess);
$this->assertResponse(403, 'Confirmed that access is denied for the private image style.');
// Verify that images are not appended to the response. Currently this test only uses PNG images.
- if (strpos($generate_url, '.png') === FALSE ) {
+ if (strpos($generate_url, '.png') === FALSE) {
$this->fail('Confirming that private image styles are not appended require PNG file.');
}
else {
diff --git a/core/modules/image/src/Tests/QuickEditImageControllerTest.php b/core/modules/image/src/Tests/QuickEditImageControllerTest.php
index 870c1bb..cfe4ccb 100644
--- a/core/modules/image/src/Tests/QuickEditImageControllerTest.php
+++ b/core/modules/image/src/Tests/QuickEditImageControllerTest.php
@@ -139,7 +139,7 @@ class QuickEditImageControllerTest extends WebTestBase {
foreach ($this->drupalGetTestFiles('image') as $image) {
/** @var \Drupal\Core\Image\ImageInterface $image_file */
$image_file = $image_factory->get($image->uri);
- if ($image_file->getWidth() < 50 || $image_file->getWidth() > 100 ) {
+ if ($image_file->getWidth() < 50 || $image_file->getWidth() > 100) {
$invalid_image = $image;
break;
}
diff --git a/core/modules/language/src/Form/NegotiationBrowserForm.php b/core/modules/language/src/Form/NegotiationBrowserForm.php
index 798d4b0..1ffd1a2 100644
--- a/core/modules/language/src/Form/NegotiationBrowserForm.php
+++ b/core/modules/language/src/Form/NegotiationBrowserForm.php
@@ -26,7 +26,7 @@ class NegotiationBrowserForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
- public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager ) {
+ public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager) {
parent::__construct($config_factory);
$this->languageManager = $language_manager;
}
diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
index c38d041..4fa08fe 100644
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
@@ -113,7 +113,7 @@ class EntityContentBaseTest extends UnitTestCase {
$this->storage->getEntityType()->willReturn($entity_type->reveal());
$destination = new EntityTestDestination(
- ['translations' => TRUE ],
+ ['translations' => TRUE],
'',
[],
$this->migration->reveal(),
diff --git a/core/modules/node/src/NodeGrantDatabaseStorage.php b/core/modules/node/src/NodeGrantDatabaseStorage.php
index 993d095..f6ae1f6 100644
--- a/core/modules/node/src/NodeGrantDatabaseStorage.php
+++ b/core/modules/node/src/NodeGrantDatabaseStorage.php
@@ -138,7 +138,7 @@ class NodeGrantDatabaseStorage implements NodeGrantDatabaseStorageInterface {
$grants = static::buildGrantsQueryCondition(node_access_grants('view', $account));
- if (count($grants) > 0 ) {
+ if (count($grants) > 0) {
$query->condition($grants);
}
return $query->execute()->fetchField();
diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php
index 4d24901..1ea8fcc 100644
--- a/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -184,7 +184,7 @@ class NodeCreationTest extends NodeTestBase {
$this->assertNoLinkByHref('/admin/structure/types/add');
// Test /node/add page without content types.
- foreach (\Drupal::entityManager()->getStorage('node_type')->loadMultiple() as $entity ) {
+ foreach (\Drupal::entityManager()->getStorage('node_type')->loadMultiple() as $entity) {
$entity->delete();
}
diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php
index dbd0534..cc0b65e 100644
--- a/core/modules/search/src/SearchQuery.php
+++ b/core/modules/search/src/SearchQuery.php
@@ -574,7 +574,7 @@ class SearchQuery extends SelectExtender {
// Add arguments for the keyword relevance normalization number.
$normalization = 1.0 / $this->normalize;
- for ($i = 0; $i < $this->relevance_count; $i++ ) {
+ for ($i = 0; $i < $this->relevance_count; $i++) {
$this->scoresArguments[':normalization_' . $i] = $normalization;
}
diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php
index 5896b38..42759c2 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -175,7 +175,7 @@ EOD;
// along by the rethrow.
assert(FALSE, 'Lorem Ipsum');
}
- catch (\AssertionError $e ) {
+ catch (\AssertionError $e) {
$this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.');
}
}
diff --git a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
index f27f82e..e567ea4 100644
--- a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
@@ -45,7 +45,7 @@ class Rotate extends GDImageToolkitOperationBase {
// Validate or set background color argument.
if (!empty($arguments['background'])) {
// Validate the background color: Color::hexToRgb does so for us.
- $background = Color::hexToRgb($arguments['background']) + ['alpha' => 0 ];
+ $background = Color::hexToRgb($arguments['background']) + ['alpha' => 0];
}
else {
// Background color is not specified: use transparent white as background.
diff --git a/core/modules/system/src/Tests/Module/InstallUninstallTest.php b/core/modules/system/src/Tests/Module/InstallUninstallTest.php
index f4db81e..a78918b 100644
--- a/core/modules/system/src/Tests/Module/InstallUninstallTest.php
+++ b/core/modules/system/src/Tests/Module/InstallUninstallTest.php
@@ -275,7 +275,7 @@ class InstallUninstallTest extends ModuleTestBase {
$all_update_functions = $post_update_registry->getPendingUpdateFunctions();
$empty_result = TRUE;
foreach ($all_update_functions as $function) {
- list($function_module, ) = explode('_post_update_', $function);
+ list($function_module,) = explode('_post_update_', $function);
if ($module === $function_module) {
$empty_result = FALSE;
break;
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index db361f3..bb69bd3 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -621,7 +621,7 @@ function system_requirements($phase) {
}
}
}
- if ($phase != 'install' && (empty($GLOBALS['config_directories']) || empty($GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY]) )) {
+ if ($phase != 'install' && (empty($GLOBALS['config_directories']) || empty($GLOBALS['config_directories'][CONFIG_SYNC_DIRECTORY]))) {
$requirements['config directories'] = [
'title' => t('Configuration directories'),
'value' => t('Not present'),
@@ -1538,7 +1538,7 @@ function system_update_8007() {
$schema = \Drupal::keyValue('entity.storage_schema.sql')->getAll();
$schema_copy = $schema;
foreach ($schema as $item_name => $item) {
- list($entity_type_id, , ) = explode('.', $item_name);
+ list($entity_type_id, ,) = explode('.', $item_name);
if (!isset($entity_types[$entity_type_id])) {
continue;
}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 7860237..13568e6 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -611,7 +611,7 @@ function system_page_attachments(array &$page) {
}
// Get the major Drupal version.
- list($version, ) = explode('.', \Drupal::VERSION);
+ list($version,) = explode('.', \Drupal::VERSION);
// Attach default meta tags.
$meta_default = [
diff --git a/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php b/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
index c58d1ec..dbd82cd 100644
--- a/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
+++ b/core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
@@ -14,7 +14,7 @@ class AdminMetaTagTest extends BrowserTestBase {
* Verify that the meta tag HTML is generated correctly.
*/
public function testMetaTag() {
- list($version, ) = explode('.', \Drupal::VERSION);
+ list($version,) = explode('.', \Drupal::VERSION);
$string = '<meta name="Generator" content="Drupal ' . $version . ' (https://www.drupal.org)" />';
$this->drupalGet('node');
$this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', 'System');
diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php b/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php
index fbf8515..599b6fb 100644
--- a/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php
+++ b/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php
@@ -65,7 +65,7 @@ class TaxonomyTermIndentationTest extends TaxonomyTestBase {
'terms[tid:' . $term2->id() . ':0][weight]' => 1,
];
- $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->get('vid' ) . '/overview', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->get('vid') . '/overview', $edit, t('Save'));
// All terms back at the root level, no indentation should be present.
$this->assertNoPattern('|<div class="js-indentation indentation">&nbsp;</div>|');
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
index 4c861ad..3d8bff8 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
@@ -18,7 +18,7 @@ class TermKernelTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['filter', 'taxonomy', 'text', 'user' ];
+ public static $modules = ['filter', 'taxonomy', 'text', 'user'];
/**
* {@inheritdoc}
diff --git a/core/modules/toolbar/toolbar.api.php b/core/modules/toolbar/toolbar.api.php
index 2ae71fb..548b488 100644
--- a/core/modules/toolbar/toolbar.api.php
+++ b/core/modules/toolbar/toolbar.api.php
@@ -109,7 +109,7 @@ function hook_toolbar() {
'#heading' => t('Shopping cart actions'),
'shopping_cart' => [
'#theme' => 'item_list',
- '#items' => [/* An item list renderable array */ ],
+ '#items' => [/* An item list renderable array */],
],
],
'#weight' => 150,
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index 16983d6..c7feaee 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -345,7 +345,7 @@ function _toolbar_do_get_rendered_subtrees(array $data) {
// Many routes have dots as route name, while some special ones like <front>
// have <> characters in them.
$url = $link->getUrlObject();
- $id = str_replace(['.', '<', '>'], ['-', '', '' ], $url->isRouted() ? $url->getRouteName() : $url->getUri());
+ $id = str_replace(['.', '<', '>'], ['-', '', ''], $url->isRouted() ? $url->getRouteName() : $url->getUri());
$subtrees[$id] = $output;
}
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index ca7a4f0..128b71b 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -254,7 +254,7 @@ class UserRegistrationTest extends WebTestBase {
$new_user = reset($accounts);
$this->assertEqual($new_user->getUsername(), $name, 'Username matches.');
$this->assertEqual($new_user->getEmail(), $mail, 'Email address matches.');
- $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.');
+ $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20), 'Correct creation time.');
$this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
$this->assertEqual($new_user->getTimezone(), $config_system_date->get('timezone.default'), 'Correct time zone field.');
$this->assertEqual($new_user->langcode->value, \Drupal::languageManager()->getDefaultLanguage()->getId(), 'Correct language field.');
diff --git a/core/modules/views/src/Plugin/views/argument/MonthDate.php b/core/modules/views/src/Plugin/views/argument/MonthDate.php
index 17ce1b9..a22824d 100644
--- a/core/modules/views/src/Plugin/views/argument/MonthDate.php
+++ b/core/modules/views/src/Plugin/views/argument/MonthDate.php
@@ -24,7 +24,7 @@ class MonthDate extends Date {
*/
public function summaryName($data) {
$month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
- return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC" ), 'custom', $this->format, 'UTC');
+ return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
}
/**
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 3c663f5..c5ce66b 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -865,10 +865,10 @@ abstract class FieldPluginBase extends HandlerBase implements FieldHandlerInterf
$optgroup_arguments = (string) t('Arguments');
$optgroup_fields = (string) t('Fields');
foreach ($previous as $id => $label) {
- $options[$optgroup_fields]["{{ $id }}"] = substr(strrchr($label, ":"), 2 );
+ $options[$optgroup_fields]["{{ $id }}"] = substr(strrchr($label, ":"), 2);
}
// Add the field to the list of options.
- $options[$optgroup_fields]["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2 );
+ $options[$optgroup_fields]["{{ {$this->options['id']} }}"] = substr(strrchr($this->adminLabel(), ":"), 2);
foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) {
$options[$optgroup_arguments]["{{ arguments.$arg }}"] = $this->t('@argument title', ['@argument' => $handler->adminLabel()]);
diff --git a/core/modules/views/src/Plugin/views/row/EntityReference.php b/core/modules/views/src/Plugin/views/row/EntityReference.php
index a985ee3..29661e3 100644
--- a/core/modules/views/src/Plugin/views/row/EntityReference.php
+++ b/core/modules/views/src/Plugin/views/row/EntityReference.php
@@ -37,7 +37,7 @@ class EntityReference extends Fields {
parent::buildOptionsForm($form, $form_state);
// Expand the description of the 'Inline field' checkboxes.
- $form['inline']['#description'] .= '<br />' . $this->t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
+ $form['inline']['#description'] .= '<br />' . $this->t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here.");
}
/**
diff --git a/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php b/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
index b4ac0be..208a6f0 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/RowEntityTest.php
@@ -47,7 +47,7 @@ class RowEntityTest extends ViewsKernelTestBase {
public function testEntityRow() {
$vocab = Vocabulary::create(['name' => $this->randomMachineName(), 'vid' => strtolower($this->randomMachineName())]);
$vocab->save();
- $term = Term::create(['name' => $this->randomMachineName(), 'vid' => $vocab->id() ]);
+ $term = Term::create(['name' => $this->randomMachineName(), 'vid' => $vocab->id()]);
$term->save();
$view = Views::getView('test_entity_row');
diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php
index cc8a77e..84db541 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -265,7 +265,7 @@ class ViewEditForm extends ViewFormBase {
// options.
$display_handler = $executable->displayHandlers->get($id);
if ($attachments = $display_handler->getAttachedDisplays()) {
- foreach ($attachments as $attachment ) {
+ foreach ($attachments as $attachment) {
$attached_options = $executable->displayHandlers->get($attachment)->getOption('displays');
unset($attached_options[$id]);
$executable->displayHandlers->get($attachment)->setOption('displays', $attached_options);
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 15b43fe..22428aa 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -118,6 +118,7 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php"/>
+ <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CloseBracketSpacingSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/CommaSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/EmptyLinesSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/WhiteSpace/NamespaceSniff.php"/>
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
index 5ded484..6c0bc1a 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -336,7 +336,7 @@ class ConfigSchemaTest extends KernelTestBase {
$effect = $effects->get($uuid)->getElements();
$this->assertTrue(!$effect['data']->isEmpty() && $effect['id']->getValue() == 'image_scale', 'Got data for the image scale effect from metadata.');
$this->assertTrue($effect['data']->get('width') instanceof IntegerInterface, 'Got the right type for the scale effect width.');
- $this->assertEqual($effect['data']->get('width')->getValue(), 480, 'Got the right value for the scale effect width.' );
+ $this->assertEqual($effect['data']->get('width')->getValue(), 480, 'Got the right value for the scale effect width.');
}
/**
diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
index e195f36..47e11da 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php
@@ -131,7 +131,7 @@ class ConnectionTest extends DatabaseTestBase {
try {
$db->query('SELECT * FROM {test}; SELECT * FROM {test_people}',
[],
- ['allow_delimiter_in_query' => TRUE ]
+ ['allow_delimiter_in_query' => TRUE]
);
$this->fail('No PDO exception thrown for multiple statements.');
}
diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
index db39f10..f3824e8 100644
--- a/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php
@@ -87,12 +87,12 @@ class CacheableMetadataTest extends UnitTestCase {
public function testAddCacheTags() {
$metadata = new CacheableMetadata();
$add_expected = [
- [[], [] ],
- [['foo:bar'], ['foo:bar'] ],
- [['foo:baz'], ['foo:bar', 'foo:baz'] ],
- [['axx:first', 'foo:baz'], ['axx:first', 'foo:bar', 'foo:baz'] ],
- [[], ['axx:first', 'foo:bar', 'foo:baz'] ],
- [['axx:first'], ['axx:first', 'foo:bar', 'foo:baz'] ],
+ [[], []],
+ [['foo:bar'], ['foo:bar']],
+ [['foo:baz'], ['foo:bar', 'foo:baz']],
+ [['axx:first', 'foo:baz'], ['axx:first', 'foo:bar', 'foo:baz']],
+ [[], ['axx:first', 'foo:bar', 'foo:baz']],
+ [['axx:first'], ['axx:first', 'foo:bar', 'foo:baz']],
];
foreach ($add_expected as $data) {
diff --git a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
index d932993c..8d0f252 100644
--- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php
@@ -320,7 +320,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
* @covers ::set
*/
public function testSet() {
- $id_items = [['value' => $this->id + 1] ];
+ $id_items = [['value' => $this->id + 1]];
$this->fieldItemList->expects($this->once())
->method('setValue')
@@ -334,7 +334,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
*/
public function testSetWithoutData() {
$this->entityAdapter->setValue(NULL);
- $id_items = [['value' => $this->id + 1] ];
+ $id_items = [['value' => $this->id + 1]];
$this->setExpectedException(MissingDataException::class);
$this->entityAdapter->set('id', $id_items);
}
@@ -397,7 +397,7 @@ class EntityAdapterUnitTest extends UnitTestCase {
$definition = $this->entityAdapter->getDataDefinition();
$this->assertInstanceOf('\Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface', $definition);
$this->assertEquals($definition->getEntityTypeId(), $this->entityTypeId);
- $this->assertEquals($definition->getBundles(), [$this->bundle ]);
+ $this->assertEquals($definition->getBundles(), [$this->bundle]);
}
/**