diff --git a/core/lib/Drupal/Core/Archiver/ArchiveTar.php b/core/lib/Drupal/Core/Archiver/ArchiveTar.php index ecd7f25..c8c8dab 100644 --- a/core/lib/Drupal/Core/Archiver/ArchiveTar.php +++ b/core/lib/Drupal/Core/Archiver/ArchiveTar.php @@ -733,11 +733,11 @@ public function setAttribute() // ----- Get the value $this->_separator = $v_att_list[$i + 1]; $i++; - break; + break; default : $this->_error('Unknown attribute code ' . $v_att_list[$i] . ''); - return false; + return false; } // ----- Next attribute @@ -1947,18 +1947,18 @@ public function _extractList( case "complete" : $v_extract_all = true; $v_listing = false; - break; + break; case "partial" : $v_extract_all = false; $v_listing = false; - break; + break; case "list" : $v_extract_all = false; $v_listing = true; - break; + break; default : $this->_error('Invalid extract mode (' . $p_mode . ')'); - return false; + return false; } clearstatcache(); diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php index fb8f658..242f076 100644 --- a/core/lib/Drupal/Core/Config/ConfigManager.php +++ b/core/lib/Drupal/Core/Config/ConfigManager.php @@ -435,7 +435,8 @@ protected function callOnDependencyRemoval(ConfigEntityInterface $entity, array // Key the entity arrays by config dependency name to make searching easy. foreach (['config', 'content'] as $dependency_type) { $affected_dependencies[$dependency_type] = array_combine( - array_map(function ($entity) { return $entity->getConfigDependencyName(); }, $affected_dependencies[$dependency_type]), + array_map(function ($entity) { return $entity->getConfigDependencyName(); + }, $affected_dependencies[$dependency_type]), $affected_dependencies[$dependency_type] ); } diff --git a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php index 87d30e9..0f35884 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php @@ -73,7 +73,7 @@ public function get(EntityTypeInterface $entity_type, $conjunction) { */ public function getAggregate(EntityTypeInterface $entity_type, $conjunction) { throw new QueryException('Aggregation over configuration entities is not supported'); - } + } /** * Gets the key value store used to store fast lookups. diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php index f36f509..221e785 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php @@ -117,7 +117,8 @@ public function __toString() { // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); - $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); }, $insert_fields); + $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); + }, $insert_fields); // If we're selecting from a SelectQuery, finish building the query and // pass it back, as any remaining options are irrelevant. diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php b/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php index d1c6d11..818a459 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php @@ -93,7 +93,8 @@ public function __toString() { // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); - $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); }, $insert_fields); + $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); + }, $insert_fields); $query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES '; diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index f2c8436..e027fbe 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -883,7 +883,8 @@ public function removeTranslation($langcode) { * {@inheritdoc} */ public function getTranslationLanguages($include_default = TRUE) { - $translations = array_filter($this->translations, function($translation) { return $translation['status']; }); + $translations = array_filter($this->translations, function($translation) { return $translation['status']; + }); unset($translations[LanguageInterface::LANGCODE_DEFAULT]); if ($include_default) { diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 9d749fb..242af1a 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -398,8 +398,8 @@ public function getBaseFieldDefinitions($entity_type_id) { // Rebuild the definitions and put it into the cache. $this->baseFieldDefinitions[$entity_type_id] = $this->buildBaseFieldDefinitions($entity_type_id); $this->cacheSet($cid, $this->baseFieldDefinitions[$entity_type_id], Cache::PERMANENT, array('entity_types', 'entity_field_info')); - } - } + } + } return $this->baseFieldDefinitions[$entity_type_id]; } diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php index 62e04f9..5a36a69 100644 --- a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php @@ -239,7 +239,7 @@ protected function finish() { } foreach ($this->sqlGroupBy as $field) { $this->sqlQuery->groupBy($field); - } + } foreach ($this->sqlFields as $field) { $this->sqlQuery->addField($field[0], $field[1], isset($field[2]) ? $field[2] : NULL); } diff --git a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php index 472ed20..4a511383 100644 --- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php +++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php @@ -295,9 +295,12 @@ public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $s */ public function getDedicatedTableNames() { $table_mapping = $this; - $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) { return $table_mapping->requiresDedicatedTableStorage($definition); }); - $data_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedDataTableName($definition); }, $definitions); - $revision_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedRevisionTableName($definition); }, $definitions); + $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) { return $table_mapping->requiresDedicatedTableStorage($definition); + }); + $data_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedDataTableName($definition); + }, $definitions); + $revision_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedRevisionTableName($definition); + }, $definitions); $dedicated_tables = array_merge(array_values($data_tables), array_values($revision_tables)); return $dedicated_tables; } diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index 6368b080..0974d69 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -1459,7 +1459,8 @@ protected function createEntitySchemaIndexes(array $entity_schema, FieldStorageD // involving them. Only indexes for which all columns exist are // actually created. $create = FALSE; - $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); }, $specifier); + $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); + }, $specifier); if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) { $create = TRUE; foreach ($specifier_columns as $specifier_column_name) { @@ -1508,7 +1509,8 @@ protected function deleteEntitySchemaIndexes(array $entity_schema_data, FieldSto foreach ($index_keys as $key => $drop_method) { if (!empty($schema[$key])) { foreach ($schema[$key] as $name => $specifier) { - $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); }, $specifier); + $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); + }, $specifier); if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) { $schema_handler->{$drop_method}($table_name, $name); } diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php index 6bdde07..5e7b7b2 100644 --- a/core/lib/Drupal/Core/Entity/entity.api.php +++ b/core/lib/Drupal/Core/Entity/entity.api.php @@ -908,7 +908,7 @@ function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) { $route_match = \Drupal::routeMatch(); \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode')); - } + } } /** diff --git a/core/lib/Drupal/Core/Field/FieldItemList.php b/core/lib/Drupal/Core/Field/FieldItemList.php index 2a7afd8..e44cc83 100644 --- a/core/lib/Drupal/Core/Field/FieldItemList.php +++ b/core/lib/Drupal/Core/Field/FieldItemList.php @@ -269,7 +269,7 @@ public function generateSampleItems($count = 1) { $values[$delta] = $field_type_class::generateSampleValue($field_definition); } $this->setValue($values); - } + } /** * {@inheritdoc} diff --git a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php index 4d0f9fe..3c9c2cf 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php @@ -33,7 +33,7 @@ class SiteSettingsForm extends FormBase { */ public function __construct($site_path) { $this->sitePath = $site_path; -} + } /** * {@inheritdoc} diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php index 9fe0e2c..d6c36a5 100644 --- a/core/lib/Drupal/Core/Path/AliasManager.php +++ b/core/lib/Drupal/Core/Path/AliasManager.php @@ -288,7 +288,7 @@ protected function pathAliasWhitelistRebuild($path = NULL) { if (!empty($path)) { if ($this->whitelist->get(strtok($path, '/'))) { return; - } + } } $this->whitelist->clear(); } diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php index c2e03c9..6f8f3d4 100644 --- a/core/lib/Drupal/Core/Render/Renderer.php +++ b/core/lib/Drupal/Core/Render/Renderer.php @@ -330,7 +330,8 @@ protected function doRender(&$elements, $is_root_call = FALSE) { if (count($elements['#lazy_builder']) !== 2) { throw new \DomainException('The #lazy_builder property must have an array as a value, containing two values: the callback, and the arguments for the callback.'); } - if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function($v) { return is_null($v) || is_scalar($v); }))) { + if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function($v) { return is_null($v) || is_scalar($v); + }))) { throw new \DomainException("A #lazy_builder callback's context may only contain scalar values or NULL."); } $children = Element::children($elements); diff --git a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php index 626f7d4..080ebde 100644 --- a/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php +++ b/core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php @@ -133,7 +133,7 @@ public function __construct(ConstraintViolationList $violations, Constraint $con $this->translator = $translator; $this->translationDomain = $translationDomain; $this->constraint = $constraint; - } + } /** * {@inheritdoc} diff --git a/core/modules/aggregator/src/Plugin/Field/FieldFormatter/AggregatorTitleFormatter.php b/core/modules/aggregator/src/Plugin/Field/FieldFormatter/AggregatorTitleFormatter.php index 6882aed..a4acd42 100644 --- a/core/modules/aggregator/src/Plugin/Field/FieldFormatter/AggregatorTitleFormatter.php +++ b/core/modules/aggregator/src/Plugin/Field/FieldFormatter/AggregatorTitleFormatter.php @@ -75,7 +75,7 @@ public function viewElements(FieldItemListInterface $items) { else { $elements[$delta] = ['#markup' => $item->value]; } - } + } return $elements; } diff --git a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php index 1c4eb17..e0a3e32 100644 --- a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +++ b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php @@ -115,6 +115,7 @@ public function testSettingsForm() { namespace { // @todo Delete after https://www.drupal.org/node/1858196 is in. if (!function_exists('drupal_set_message')) { - function drupal_set_message() {} + function drupal_set_message() { + } } } diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index 9a582352..c6728ed 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -242,6 +242,6 @@ public static function preRender($build) { } } return $build; - } + } } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncUnitTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncUnitTest.php index 53c5b0a..cd6eda8 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSyncUnitTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncUnitTest.php @@ -186,13 +186,17 @@ public function testMultipleSyncedValues() { // their delta. $delta_callbacks = array( // Continuous field values: all values are equal. - function($delta) { return TRUE; }, + function($delta) { return TRUE; + }, // Alternated field values: only the even ones are equal. - function($delta) { return $delta % 2 !== 0; }, + function($delta) { return $delta % 2 !== 0; + }, // Sparse field values: only the "middle" ones are equal. - function($delta) { return $delta === 1 || $delta === 2; }, + function($delta) { return $delta === 1 || $delta === 2; + }, // Sparse field values: only the "extreme" ones are equal. - function($delta) { return $delta === 0 || $delta === 3; }, + function($delta) { return $delta === 0 || $delta === 3; + }, ); foreach ($delta_callbacks as $delta_callback) { diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php index 69f3725..8e7493f 100644 --- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php @@ -578,7 +578,7 @@ function testDatelistWidget() { $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertResponse(200); $this->assertOptionSelected("edit-$field_name-0-value-minute", '0', 'Correct minute selected.'); - } + } /** * The data provider for testing the validation of the datelist widget. diff --git a/core/modules/field_ui/src/Form/FieldConfigEditForm.php b/core/modules/field_ui/src/Form/FieldConfigEditForm.php index ba972a9..c9f07be 100644 --- a/core/modules/field_ui/src/Form/FieldConfigEditForm.php +++ b/core/modules/field_ui/src/Form/FieldConfigEditForm.php @@ -172,7 +172,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $default_value = $items->defaultValuesFormSubmit($form['default_value'], $form, $form_state); } $this->entity->setDefaultValue($default_value); -} + } /** * {@inheritdoc} diff --git a/core/modules/filter/src/Plugin/DataType/FilterFormat.php b/core/modules/filter/src/Plugin/DataType/FilterFormat.php index 74279f0..d3d7af8 100644 --- a/core/modules/filter/src/Plugin/DataType/FilterFormat.php +++ b/core/modules/filter/src/Plugin/DataType/FilterFormat.php @@ -32,7 +32,8 @@ public function getPossibleValues(AccountInterface $account = NULL) { * {@inheritdoc} */ public function getPossibleOptions(AccountInterface $account = NULL) { - return array_map(function ($format) { return $format->label(); }, filter_formats()); + return array_map(function ($format) { return $format->label(); + }, filter_formats()); } /** @@ -47,6 +48,7 @@ public function getSettableValues(AccountInterface $account = NULL) { */ public function getSettableOptions(AccountInterface $account = NULL) { // @todo: Avoid calling functions but move to injected dependencies. - return array_map(function ($format) { return $format->label(); }, filter_formats($account)); + return array_map(function ($format) { return $format->label(); + }, filter_formats($account)); } } diff --git a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php index d4a7b43..c40f4d8 100644 --- a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php +++ b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php @@ -115,7 +115,7 @@ public function testMissingEffectPlugin() { } // There should be only the one message. $this->assertEqual($count, 1); - } + } /** * Test that missing action's causes failures. @@ -145,7 +145,7 @@ public function testInvalidCropValues() { $this->assertEqual(['error' => [ 'The Drupal 8 image crop effect does not support numeric values for x and y offsets. Use keywords to set crop effect offsets instead.' ]], $this->migrateMessages); - } + } /** * Assert that a given image effect is migrated. diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php index 768e0fc..3795116 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php +++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php @@ -79,7 +79,7 @@ protected function getMigration() { $migration->method('set') ->willReturnCallback(function ($argument, $value) use (&$configuration) { $configuration[$argument] = $value; - }); + }); $migration->method('id') ->willReturn($configuration['id']); @@ -139,7 +139,8 @@ protected function getDatabase(array $database_contents, $connection_options = [ protected function createSchemaFromRow(array $row) { // SQLite uses loose ("affinity") typing, so it's OK for every column // to be a text field. - $fields = array_map(function() { return ['type' => 'text']; }, $row); + $fields = array_map(function() { return ['type' => 'text']; + }, $row); return ['fields' => $fields]; } diff --git a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php index 5e024d6..12d2133 100644 --- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php +++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php @@ -162,6 +162,7 @@ protected function entityQueryExpects($count) { ->will($this->returnValue($this->entityQuery)); $this->entityQuery->expects($this->exactly($count + 1)) ->method('execute') - ->will($this->returnCallback(function () use (&$count) { return $count--;})); + ->will($this->returnCallback(function () use (&$count) { return $count--; + })); } } diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php index bdcf27c..a6786ae 100644 --- a/core/modules/migrate/tests/src/Unit/process/GetTest.php +++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php @@ -48,7 +48,8 @@ public function testTransformSourceArray() { $this->plugin->setSource(array('test1', 'test2')); $this->row->expects($this->exactly(2)) ->method('getSourceProperty') - ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; } )); + ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; + } )); $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty'); $this->assertSame($value, array('source_value1', 'source_value2')); } @@ -79,7 +80,8 @@ public function testTransformSourceArrayAt() { $this->plugin->setSource(array('test1', '@@test2', '@@test3', 'test4')); $this->row->expects($this->exactly(4)) ->method('getSourceProperty') - ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; } )); + ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; + } )); $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty'); $this->assertSame($value, array('source_value1', 'source_value2', 'source_value3', 'source_value4')); } diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php index deb7adf..9e7c9f6 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php @@ -78,7 +78,7 @@ public function getSystemData() { } } return $this->systemData; - } + } /** * {@inheritdoc} diff --git a/core/modules/node/src/Plugin/views/filter/Status.php b/core/modules/node/src/Plugin/views/filter/Status.php index 5e119e5..c018474 100644 --- a/core/modules/node/src/Plugin/views/filter/Status.php +++ b/core/modules/node/src/Plugin/views/filter/Status.php @@ -23,7 +23,8 @@ public function adminSummary() { } protected function operatorForm(&$form, FormStateInterface $form_state) { } - public function canExpose() { return FALSE; } + public function canExpose() { return FALSE; + } public function query() { $table = $this->ensureMyTable(); diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php index ae7eaaa..bc873ed 100644 --- a/core/modules/serialization/src/Normalizer/NormalizerBase.php +++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php @@ -77,6 +77,6 @@ protected function checkFormat($format = NULL) { } return in_array($format, (array) $this->format); - } + } } diff --git a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php index 06a4b5d..5b9fce3 100644 --- a/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php +++ b/core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php @@ -75,6 +75,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ); return parent::buildForm($form, $form_state); - } + } } diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index b94afcf..ff0447a 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -536,7 +536,7 @@ protected function getAssertionCall() { substr($caller['function'], 0, 6) == 'assert')) { // We remove that call. array_shift($backtrace); - } + } return Error::getLastCaller($backtrace); } diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php index 4113263..0ea2012 100644 --- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php +++ b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php @@ -92,7 +92,7 @@ public function testSimpleAJAXFormValue() { 'new' => $build_id_from_cache_second_ajax, ]; $this->assertCommand($commands, $expected, 'Build id change command issued on subsequent AJAX submissions'); - } + } /** * Tests a form that uses an #ajax callback. diff --git a/core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php b/core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php index 93e1a89..8a4e3a9 100644 --- a/core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php +++ b/core/modules/system/tests/modules/httpkernel_test/src/HttpKernel/TestMiddleware.php @@ -40,7 +40,7 @@ class TestMiddleware implements HttpKernelInterface { public function __construct(HttpKernelInterface $kernel, $optional_argument = NULL) { $this->kernel = $kernel; $this->optionalArgument = $optional_argument; - } + } /** * {@inheritdoc} diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 01086b0..0e30308 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -89,9 +89,11 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o } } - public function hasExtraOptions() { return TRUE; } + public function hasExtraOptions() { return TRUE; + } - public function getValueOptions() { /* don't overwrite the value options */ } + public function getValueOptions() { /* don't overwrite the value options */ + } protected function defineOptions() { $options = parent::defineOptions(); diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index e54dc96..733d64f 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -264,6 +264,6 @@ function testResetImpersonation() { $this->assertNoText($user2->getUsername(), 'The invalid password reset page does not show the user name.'); $this->assertUrl('user/password', array(), 'The user is redirected to the password reset request page.'); $this->assertText('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.'); - } + } } diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php index c6ae4b7..9bc9cae 100644 --- a/core/modules/views/src/Plugin/views/HandlerBase.php +++ b/core/modules/views/src/Plugin/views/HandlerBase.php @@ -377,7 +377,8 @@ public function submitGroupByForm(&$form, FormStateInterface $form_state) { * If a handler has 'extra options' it will get a little settings widget and * another form called extra_options. */ - public function hasExtraOptions() { return FALSE; } + public function hasExtraOptions() { return FALSE; + } /** * Provide defaults for the handler. @@ -403,7 +404,8 @@ public function submitExtraOptionsForm($form, FormStateInterface $form_state) { /** * Determine if a handler can be exposed. */ - public function canExpose() { return FALSE; } + public function canExpose() { return FALSE; + } /** * Set new exposed option defaults when exposed setting is flipped @@ -573,24 +575,28 @@ public function isExposed() { /** * Returns TRUE if the exposed filter works like a grouped filter. */ - public function isAGroup() { return FALSE; } + public function isAGroup() { return FALSE; + } /** * Define if the exposed input has to be submitted multiple times. * This is TRUE when exposed filters grouped are using checkboxes as * widgets. */ - public function multipleExposedInput() { return FALSE; } + public function multipleExposedInput() { return FALSE; + } /** * Take input from exposed handlers and assign to this handler, if necessary. */ - public function acceptExposedInput($input) { return TRUE; } + public function acceptExposedInput($input) { return TRUE; + } /** * If set to remember exposed input in the session, store it there. */ - public function storeExposedInput($input, $status) { return TRUE; } + public function storeExposedInput($input, $status) { return TRUE; + } /** * {@inheritdoc} @@ -614,7 +620,8 @@ public function getJoin() { /** * {@inheritdoc} */ - public function validate() { return array(); } + public function validate() { return array(); + } /** * {@inheritdoc} diff --git a/core/modules/views/src/Plugin/views/PluginBase.php b/core/modules/views/src/Plugin/views/PluginBase.php index 449cc23..1a55781 100644 --- a/core/modules/views/src/Plugin/views/PluginBase.php +++ b/core/modules/views/src/Plugin/views/PluginBase.php @@ -160,7 +160,8 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o * @return array * Returns the options of this handler/plugin. */ - protected function defineOptions() { return array(); } + protected function defineOptions() { return array(); + } /** * Fills up the options of the plugin with defaults. @@ -299,7 +300,8 @@ public function themeFunctions() { /** * {@inheritdoc} */ - public function validate() { return array(); } + public function validate() { return array(); + } /** * {@inheritdoc} diff --git a/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php b/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php index b5c2adf..53ee338 100644 --- a/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php @@ -64,7 +64,8 @@ public function setArgument(ArgumentPluginBase $argument) { * Retrieve the options when this is a new access * control plugin */ - protected function defineOptions() { return array(); } + protected function defineOptions() { return array(); + } /** * Provide the default form for setting options. @@ -85,7 +86,8 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state, &$opti * Determine if the administrator has the privileges to use this * plugin */ - public function access() { return TRUE; } + public function access() { return TRUE; + } /** * If we don't have access to the form but are showing it anyway, ensure that diff --git a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php index 7a6cf67..49cd281 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php @@ -60,7 +60,8 @@ public function setArgument(ArgumentPluginBase $argument) { * Retrieve the options when this is a new access * control plugin */ - protected function defineOptions() { return array(); } + protected function defineOptions() { return array(); + } /** * Provide the default form for setting options. @@ -80,7 +81,8 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state, &$opti /** * Determine if the administrator has the privileges to use this plugin */ - public function access() { return TRUE; } + public function access() { return TRUE; + } /** * If we don't have access to the form but are showing it anyway, ensure that @@ -97,7 +99,8 @@ protected function checkAccess(&$form, $option_name) { } } - public function validateArgument($arg) { return TRUE; } + public function validateArgument($arg) { return TRUE; + } /** * Process the summary arguments for displaying. diff --git a/core/modules/views/src/Plugin/views/display/Block.php b/core/modules/views/src/Plugin/views/display/Block.php index 8e4e5d2..0928ebf 100644 --- a/core/modules/views/src/Plugin/views/display/Block.php +++ b/core/modules/views/src/Plugin/views/display/Block.php @@ -355,7 +355,7 @@ public function usesExposed() { return parent::usesExposed(); } return FALSE; - } + } /** * {@inheritdoc} diff --git a/core/modules/views/src/Plugin/views/display/DefaultDisplay.php b/core/modules/views/src/Plugin/views/display/DefaultDisplay.php index 8615dd5..3232e61 100644 --- a/core/modules/views/src/Plugin/views/display/DefaultDisplay.php +++ b/core/modules/views/src/Plugin/views/display/DefaultDisplay.php @@ -33,7 +33,8 @@ class DefaultDisplay extends DisplayPluginBase { * Determine if this display is the 'default' display which contains * fallback settings */ - public function isDefaultDisplay() { return TRUE; } + public function isDefaultDisplay() { return TRUE; + } /** * The default execute handler fully renders the view. diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 980da73..5d50c01 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -242,7 +242,8 @@ public function destroy() { /** * {@inheritdoc} */ - public function isDefaultDisplay() { return FALSE; } + public function isDefaultDisplay() { return FALSE; + } /** * {@inheritdoc} @@ -673,17 +674,20 @@ protected function defineOptions() { /** * {@inheritdoc} */ - public function hasPath() { return FALSE; } + public function hasPath() { return FALSE; + } /** * {@inheritdoc} */ - public function usesLinkDisplay() { return !$this->hasPath(); } + public function usesLinkDisplay() { return !$this->hasPath(); + } /** * {@inheritdoc} */ - public function usesExposedFormInBlock() { return $this->hasPath(); } + public function usesExposedFormInBlock() { return $this->hasPath(); + } /** * {@inheritdoc} @@ -1482,7 +1486,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title' => $this->t('Show contextual links'), '#default_value' => $this->getOption('show_admin_links'), ); - break; + break; case 'use_more': $form['#title'] .= $this->t('Add a more link to the bottom of the display.'); $form['use_more'] = array( @@ -1877,7 +1881,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) { if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) { $form_state->setError($form['css_class'], $this->t('CSS classes must be alphanumeric or dashes only.')); } - break; + break; case 'display_id': if ($form_state->getValue('display_id')) { if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) { diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php index c60df58..05e38e3 100644 --- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php @@ -177,7 +177,8 @@ public function adminSummary() { /** * Determine if a filter can be exposed. */ - public function canExpose() { return TRUE; } + public function canExpose() { return TRUE; + } /** * Determine if a filter can be converted into a group. @@ -305,7 +306,8 @@ protected function operatorForm(&$form, FormStateInterface $form_state) { * Provide a list of options for the default operator form. * Should be overridden by classes that don't override operatorForm */ - public function operatorOptions() { return array(); } + public function operatorOptions() { return array(); + } /** * Validate the operator form. diff --git a/core/modules/views/src/Plugin/views/filter/GroupByNumeric.php b/core/modules/views/src/Plugin/views/filter/GroupByNumeric.php index 656e7c8..585be37 100644 --- a/core/modules/views/src/Plugin/views/filter/GroupByNumeric.php +++ b/core/modules/views/src/Plugin/views/filter/GroupByNumeric.php @@ -57,6 +57,7 @@ public function adminLabel($short = FALSE) { return $this->getField(parent::adminLabel($short)); } - public function canGroup() { return FALSE; } + public function canGroup() { return FALSE; + } } diff --git a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php index 81b4505..a20e10c 100644 --- a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php +++ b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php @@ -32,7 +32,8 @@ /** * Determine if a sort can be exposed. */ - public function canExpose() { return TRUE; } + public function canExpose() { return TRUE; + } /** * Called to add the sort to a query. diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php index 7274abd..23d1903 100644 --- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php @@ -407,7 +407,8 @@ public function wizardSubmit(&$form, FormStateInterface $form_state, WizardInter * interfere with the sorts. If so it should build; if it returns * any non-TRUE value, normal sorting will NOT be added to the query. */ - public function buildSort() { return TRUE; } + public function buildSort() { return TRUE; + } /** * Called by the view builder to let the style build a second set of diff --git a/core/modules/views/src/Tests/Handler/SortDateTest.php b/core/modules/views/src/Tests/Handler/SortDateTest.php index b494cf6..6c0f28f 100644 --- a/core/modules/views/src/Tests/Handler/SortDateTest.php +++ b/core/modules/views/src/Tests/Handler/SortDateTest.php @@ -83,7 +83,7 @@ protected function expectedResultSet($granularity, $reverse = TRUE) { array('name' => 'Meredith'), ); break; - } + } } else { switch ($granularity) { diff --git a/core/modules/views/src/Tests/Plugin/StyleGridTest.php b/core/modules/views/src/Tests/Plugin/StyleGridTest.php index d5d7e60..ae8d2a7 100644 --- a/core/modules/views/src/Tests/Plugin/StyleGridTest.php +++ b/core/modules/views/src/Tests/Plugin/StyleGridTest.php @@ -81,11 +81,16 @@ protected function assertGrid(ViewExecutable $view, $alignment, $columns) { } $width = '0'; switch ($columns) { - case 5: $width = '20'; break; - case 4: $width = '25'; break; - case 3: $width = '33.3333'; break; - case 2: $width = '50'; break; - case 1: $width = '100'; break; + case 5: $width = '20'; + break; + case 4: $width = '25'; + break; + case 3: $width = '33.3333'; + break; + case 2: $width = '50'; + break; + case 1: $width = '100'; + break; } // Ensure last column exists. $result = $this->xpath('//div[contains(@class, "views-col") and contains(@class, :columns) and starts-with(@style, :width)]', array(':columns' => 'col-' . $columns, ':width' => 'width: ' . $width)); diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php index c8bac31..1664787 100644 --- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php +++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php @@ -95,7 +95,7 @@ public function build(ViewExecutable $view) { // @todo You could add a string representation of the query. $this->view->build_info['query'] = ""; $this->view->build_info['count_query'] = ""; -} + } /** * Implements Drupal\views\Plugin\views\query\QueryPluginBase::execute(). diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php index ec2abec..a2e9a7b 100644 --- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php @@ -148,7 +148,8 @@ public function testValidateParameterTypes($token, $value) { // The following check might throw PHP fatals and notices, so we disable // error assertions. - set_error_handler(function () {return TRUE;}); + set_error_handler(function () {return TRUE; + }); $this->assertFalse($this->generator->validate($token, $value)); restore_error_handler(); } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index 9a67a26..fc2416f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -198,7 +198,7 @@ protected function setUpEntityManager($definitions = array()) { return NULL; } else throw new PluginNotFoundException($entity_type_id); - }); + }); $this->discovery->getDefinitions()->willReturn($definitions); } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php index 022a232..eead1ce 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php @@ -233,7 +233,7 @@ public function testUrl() { if ($route_name === 'entity.test_entity_type.canonical' && $route_parameters === array('test_entity_type' => 'test_entity_id') && array_keys($options) === ['absolute', 'entity_type', 'entity', 'language'] && $options['language'] == $language) { return 'http://drupal/entity/test_entity_type/test_entity_id'; } - }); + }); $this->assertSame('/entity/test_entity_type/test_entity_id', $valid_entity->url()); $this->assertSame('http://drupal/entity/test_entity_type/test_entity_id', $valid_entity->url('canonical', array('absolute' => TRUE))); diff --git a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc index 3576f28..45062b9 100644 --- a/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc +++ b/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc @@ -1,3 +1,4 @@ assertEquals(['tag.example1', 'tag.example2'], $cacheability->getCacheTags()); $this->assertEquals(['context.example1', 'context.example2', 'route', 'user.permissions'], $cacheability->getCacheContexts()); - } + } protected function setupFactoryAndLocalTaskPlugins(array $definitions, $active_plugin_id) { $map = []; diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php index c621e62..f74b8f3 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php @@ -330,7 +330,7 @@ public function testConditionalCacheContextBubblingSelfHealing() { '#access_callback' => function () use (&$current_user_role) { // Only role C can access this subtree. return $current_user_role === 'C'; - }, + }, '#cache' => [ 'contexts' => ['bar'], 'tags' => ['d'], diff --git a/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php b/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php index 2e35ca0..d2d83fc 100644 --- a/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php +++ b/core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php @@ -138,5 +138,6 @@ public function testSetFormat() { } class StubNegotiationMiddleware extends NegotiationMiddleware { - public function getContentType(Request $request) { return parent::getContentType($request); } + public function getContentType(Request $request) { return parent::getContentType($request); + } } diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableStringTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableStringTest.php index 862a78a..5204bfb 100644 --- a/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableStringTest.php +++ b/core/tests/Drupal/Tests/Core/StringTranslation/TranslatableStringTest.php @@ -73,7 +73,7 @@ public function testToString() { ->with($text) ->willReturnCallback(function () { throw new \Exception('Yes you may.'); - }); + }); // We set a custom error handler because of https://github.com/sebastianbergmann/phpunit/issues/487 set_error_handler([$this, 'errorHandler']);