diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Condition.php b/core/lib/Drupal/Core/Config/Entity/Query/Condition.php index 23971eafc28f025c45516ef5a48b0c260c62c82d..bd2facd18fe8070c3b6c918ccd52d27a19ecb81f 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 @@ public function compile($configs) { // 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 9fea3df47307389dcf4932455c79da6024ec2e28..c8d189e480e05eef455c3de5c77b427fad0d90c1 100644 --- a/core/lib/Drupal/Core/Config/InstallStorage.php +++ b/core/lib/Drupal/Core/Config/InstallStorage.php @@ -133,7 +133,7 @@ public function listAll($prefix = '') { 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 c9eb3f85a3284a919a2dedf3d29d91e95635fc6d..70d9a333ce04b1f0073974527bc128e2bcabeca5 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 @@ public function initializeDatabase() { \'SELECT random();\' LANGUAGE \'sql\'', [], - ['allow_delimiter_in_query' => TRUE ] + ['allow_delimiter_in_query' => TRUE] ); } @@ -263,7 +263,7 @@ public function initializeDatabase() { \'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 0c17ce2e02c7efaae3263fe3f0359b6bc74aadd9..d6c9cb6033ac454bb70703167fefb7a88ef42e7a 100644 --- a/core/lib/Drupal/Core/Diff/DiffFormatter.php +++ b/core/lib/Drupal/Core/Diff/DiffFormatter.php @@ -192,7 +192,7 @@ protected function _changed($orig, $closing) { // 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 5f6589a6b4afb27d11afa0165b59b66cdc6228af..9584ed3e26511dac2b420aa516f128d91d6fde20 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -313,7 +313,7 @@ public function __construct($definition) { // 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 bd5a71037309746b9d93ccbbdc5a4cab1d7a5390..db194b5485262e06b78670c6e112cb8843ffc8e2 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 b24ac67657f3b7d7d53253d965fb706b89fcec28..a4e0081cf16d82ee7b4514108d6bd3ec4af2734d 100644 --- a/core/lib/Drupal/Core/Update/UpdateRegistry.php +++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php @@ -226,7 +226,7 @@ public function getModuleUpdateFunctions($module_name) { $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 6b52643bc543613117f7f22cc46a5593b775768e..5b01099fd216a37e4d9ba07d30c8afe57fe81b3c 100644 --- a/core/modules/action/tests/src/Functional/ActionUninstallTest.php +++ b/core/modules/action/tests/src/Functional/ActionUninstallTest.php @@ -27,7 +27,7 @@ public function testActionUninstall() { $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 176c32674f0d2fcf000a7415b547c2b201a4a061..35af61ed5429ffcf3c3e5304fdefcc9e6c3fec83 100644 --- a/core/modules/block/src/BlockAccessControlHandler.php +++ b/core/modules/block/src/BlockAccessControlHandler.php @@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * @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 ff9e4cde4035da60c9d340c35c73e1255c5e4254..4308969e2dcc18702f0b1b8f26985c1b2c039469 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 dfc50f21aa80737293021bc158fb301e4e70a3b3..a24bedb64066fc41df46242be454a4cbc27fe029 100644 --- a/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php +++ b/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php @@ -347,7 +347,7 @@ public function testDeleteNoData() { 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 bed2ff68292a83a21f66bed0c605661f5d119ab1..87eb97329f003a3044e875ac4c528b7183330266 100644 --- a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php @@ -135,7 +135,7 @@ public function testMarkFieldForDeletion() { ], '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 8296601babe378c241f0c6760f57c7eab7dde713..baa4e7fd533d569224698e23292bdcb60da0f654 100644 --- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php @@ -193,7 +193,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s $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 870c1bb5d5d30fdc0f4b5c8017ea0dde7a3f0e45..cfe4ccbfb14394781742bcc657b37f02522dde51 100644 --- a/core/modules/image/src/Tests/QuickEditImageControllerTest.php +++ b/core/modules/image/src/Tests/QuickEditImageControllerTest.php @@ -139,7 +139,7 @@ public function testInvalidUpload() { 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 798d4b06b0cd3a4b7ec32ad9ec5735beff3beb33..1ffd1a2c5c3fc8cda6f34d61b5a1c4d36a71b3a9 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 c38d04184bf50e0ef1ad8d564eaece0aceb1993f..4fa08fed0a200d2d69e285f41afa74eb75f94f36 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 @@ public function testUntranslatable() { $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 993d0950d1a29a0e3899908c8030aaa452609a91..f6ae1f6c1343982a8aa06b240038002722d28997 100644 --- a/core/modules/node/src/NodeGrantDatabaseStorage.php +++ b/core/modules/node/src/NodeGrantDatabaseStorage.php @@ -138,7 +138,7 @@ public function checkAll(AccountInterface $account) { $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 4d24901e58bdbdf5f6173c44d38c2ea435c39118..1ea8fcc3326caeb705b4a68f776af16f8a2dba95 100644 --- a/core/modules/node/tests/src/Functional/NodeCreationTest.php +++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php @@ -184,7 +184,7 @@ public function testNodeAddWithoutContentTypes() { $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 dbd0534235cc542f68c9cf72aafadde6cb8be160..cc0b65e07b525d21a5d104e1a28acfb397941acf 100644 --- a/core/modules/search/src/SearchQuery.php +++ b/core/modules/search/src/SearchQuery.php @@ -574,7 +574,7 @@ public function execute() { // 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 5896b384a4c298dcfe86c04f5cc04f2cbc389d9b..42759c255ae2d7daaf04b00ce6d4ebf098ac8f77 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -175,7 +175,7 @@ public function stubTest() { // 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 f27f82e6455f5f1297298b0dbd46d0666e26dd92..e567ea43f261215758e0f9d75cb8eb4afe488bd8 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 @@ protected function validateArguments(array $arguments) { // 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 f4db81e18e02246d53bf50dd05ec2d415a79b9d7..a78918bc941a5a044b9f3e8bc5b8596f240ba4c0 100644 --- a/core/modules/system/src/Tests/Module/InstallUninstallTest.php +++ b/core/modules/system/src/Tests/Module/InstallUninstallTest.php @@ -275,7 +275,7 @@ protected function assertInstallModuleUpdates($module) { $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 db361f3971066a0b669e6923a585232b72f4dd21..bb69bd33f5356ce2535310f9e445ffd15eab33f0 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 7860237c3bb69b1899269d438f5891b3062febbb..13568e61c2543b1d6854c6f7fb862fb3bd81d1d5 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 c58d1ec9106d1aff3c9ef04b9189d22a18528e97..dbd82cda02f08cc222d2b626e3f653fc1f648f31 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 = ''; $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 fbf8515ea777a06a851f01474f1f43887e92062f..599b6fb2c7a790244aa18e90ba71017c0a23337e 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php @@ -65,7 +65,7 @@ public function testTermIndentation() { '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('|