diff --git a/core/includes/file.inc b/core/includes/file.inc
index 228515d..7f3127e 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -1030,7 +1030,7 @@ function file_scan_directory($dir, $mask, $options = [], $depth = 0) {
   // performance boost.
   if (!isset($options['nomask'])) {
     $ignore_directories = Settings::get('file_scan_ignore_directories', []);
-    array_walk($ignore_directories, function(&$value) {
+    array_walk($ignore_directories, function (&$value) {
       $value = preg_quote($value, '/');
     });
     $default_nomask = '/^' . implode('|', $ignore_directories) . '$/';
diff --git a/core/lib/Drupal/Component/Assertion/Handle.php b/core/lib/Drupal/Component/Assertion/Handle.php
index 5069b6b..f1e1e6a 100644
--- a/core/lib/Drupal/Component/Assertion/Handle.php
+++ b/core/lib/Drupal/Component/Assertion/Handle.php
@@ -25,7 +25,7 @@ public static function register() {
         require __DIR__ . '/global_namespace_php5.php';
       }
       // PHP 5 - create a handler to throw the exception directly.
-      assert_options(ASSERT_CALLBACK, function($file = '', $line = 0, $code = '', $message = '') {
+      assert_options(ASSERT_CALLBACK, function ($file = '', $line = 0, $code = '', $message = '') {
         if (empty($message)) {
           $message = $code;
         }
diff --git a/core/lib/Drupal/Component/Utility/Unicode.php b/core/lib/Drupal/Component/Utility/Unicode.php
index 98db804..6590704 100644
--- a/core/lib/Drupal/Component/Utility/Unicode.php
+++ b/core/lib/Drupal/Component/Utility/Unicode.php
@@ -376,7 +376,7 @@ public static function lcfirst($text) {
    */
   public static function ucwords($text) {
     $regex = '/(^|[' . static::PREG_CLASS_WORD_BOUNDARY . '])([^' . static::PREG_CLASS_WORD_BOUNDARY . '])/u';
-    return preg_replace_callback($regex, function(array $matches) {
+    return preg_replace_callback($regex, function (array $matches) {
       return $matches[1] . Unicode::strtoupper($matches[2]);
     }, $text);
   }
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
index 5f23af4..30577ef 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
@@ -175,7 +175,7 @@ public function getAll() {
   public function deleteAll() {
     $this->state->delete('drupal_css_cache_files');
 
-    $delete_stale = function($uri) {
+    $delete_stale = function ($uri) {
       // Default stale file threshold is 30 days.
       if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
         file_unmanaged_delete($uri);
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
index 4d49d87..0a47efc 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
@@ -178,7 +178,7 @@ public function getAll() {
    */
   public function deleteAll() {
     $this->state->delete('system.js_cache_files');
-    $delete_stale = function($uri) {
+    $delete_stale = function ($uri) {
       // Default stale file threshold is 30 days.
       if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
         file_unmanaged_delete($uri);
diff --git a/core/lib/Drupal/Core/Config/CachedStorage.php b/core/lib/Drupal/Core/Config/CachedStorage.php
index 7286fbc..f43ede2 100644
--- a/core/lib/Drupal/Core/Config/CachedStorage.php
+++ b/core/lib/Drupal/Core/Config/CachedStorage.php
@@ -278,7 +278,7 @@ protected function getCacheKey($name) {
    */
   protected function getCacheKeys(array $names) {
     $prefix = $this->getCollectionPrefix();
-    $cache_keys = array_map(function($name) use ($prefix) {
+    $cache_keys = array_map(function ($name) use ($prefix) {
       return $prefix . $name;
     }, $names);
 
diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php
index 8c06cd1..e43a36c 100644
--- a/core/lib/Drupal/Core/Config/ConfigFactory.php
+++ b/core/lib/Drupal/Core/Config/ConfigFactory.php
@@ -306,7 +306,7 @@ protected function getConfigCacheKey($name, $immutable) {
    *   An array of cache keys that match the provided config name.
    */
   protected function getConfigCacheKeys($name) {
-    return array_filter(array_keys($this->cache), function($key) use ($name) {
+    return array_filter(array_keys($this->cache), function ($key) use ($name) {
       // Return TRUE if the key is the name or starts with the configuration
       // name plus the delimiter.
       return $key === $name || strpos($key, $name . ':') === 0;
diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php
index b023764..242d920 100644
--- a/core/lib/Drupal/Core/Config/ConfigInstaller.php
+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -185,7 +185,7 @@ public function installOptionalConfig(StorageInterface $storage = NULL, $depende
     $existing_config = $this->getActiveStorages()->listAll();
 
     $list = array_unique(array_merge($storage->listAll(), $optional_profile_config));
-    $list = array_filter($list, function($config_name) use ($existing_config) {
+    $list = array_filter($list, function ($config_name) use ($existing_config) {
       // Only list configuration that:
       // - does not already exist
       // - is a configuration entity (this also excludes config that has an
diff --git a/core/lib/Drupal/Core/Config/ConfigManager.php b/core/lib/Drupal/Core/Config/ConfigManager.php
index 7ec824b..8b3b3d6 100644
--- a/core/lib/Drupal/Core/Config/ConfigManager.php
+++ b/core/lib/Drupal/Core/Config/ConfigManager.php
@@ -233,7 +233,7 @@ public function getConfigDependencyManager() {
     // dependencies on the config entity classes. Assume data with UUID is a
     // config entity. Only configuration entities can be depended on so we can
     // ignore everything else.
-    $data = array_map(function($config) {
+    $data = array_map(function ($config) {
       $data = $config->get();
       if (isset($data['uuid'])) {
         return $data;
diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Query.php b/core/lib/Drupal/Core/Config/Entity/Query/Query.php
index 918853d..4566cb1 100644
--- a/core/lib/Drupal/Core/Config/Entity/Query/Query.php
+++ b/core/lib/Drupal/Core/Config/Entity/Query/Query.php
@@ -88,7 +88,7 @@ public function execute() {
     foreach ($this->sort as $sort) {
       $direction = $sort['direction'] == 'ASC' ? -1 : 1;
       $field = $sort['field'];
-      uasort($result, function($a, $b) use ($field, $direction) {
+      uasort($result, function ($a, $b) use ($field, $direction) {
         return ($a[$field] <= $b[$field]) ? $direction : -$direction;
       });
     }
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
index 3acb482..ce25e64 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
@@ -128,7 +128,7 @@ 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) {
+    $insert_fields = array_map(function ($f) {
       return $this->connection->escapeField($f);
     }, $insert_fields);
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php b/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
index 95eff55..03f9db0 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
@@ -100,7 +100,7 @@ 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) {
+    $insert_fields = array_map(function ($f) {
       return $this->connection->escapeField($f);
     }, $insert_fields);
 
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
index d5fdbe2..bb7b821 100644
--- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
@@ -108,7 +108,7 @@ public function format($format, $settings = []) {
       $format = parent::format($format, $settings);
 
       // Translates a formatted date string.
-      $translation_callback = function($matches) use ($langcode) {
+      $translation_callback = function ($matches) use ($langcode) {
         $code = $matches[1];
         $string = $matches[2];
         if (!isset($this->formatTranslationCache[$langcode][$code][$string])) {
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
index 8818f62..2c62589 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -916,7 +916,7 @@ public function getTranslationStatus($langcode) {
    * {@inheritdoc}
    */
   public function getTranslationLanguages($include_default = TRUE) {
-    $translations = array_filter($this->translations, function($translation) {
+    $translations = array_filter($this->translations, function ($translation) {
       return $translation['status'];
     });
     unset($translations[LanguageInterface::LANGCODE_DEFAULT]);
diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
index e92930a..874a341 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -153,10 +153,10 @@ protected function initFieldValues(ContentEntityInterface $entity, array $values
    */
   public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []) {
     $translation = $entity->getTranslation($langcode);
-    $definitions = array_filter($translation->getFieldDefinitions(), function(FieldDefinitionInterface $definition) {
+    $definitions = array_filter($translation->getFieldDefinitions(), function (FieldDefinitionInterface $definition) {
       return $definition->isTranslatable();
     });
-    $field_names = array_map(function(FieldDefinitionInterface $definition) {
+    $field_names = array_map(function (FieldDefinitionInterface $definition) {
       return $definition->getName();
     }, $definitions);
     $values[$this->langcodeKey] = $langcode;
diff --git a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
index 466032d..e82ed81 100644
--- a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
+++ b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
@@ -77,7 +77,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
     // Potentially the #value is set directly, so it contains the 'target_id'
     // array structure instead of a string.
     if ($input !== FALSE && is_array($input)) {
-      $entity_ids = array_map(function(array $item) {
+      $entity_ids = array_map(function (array $item) {
         return $item['target_id'];
       }, $input);
 
diff --git a/core/lib/Drupal/Core/Entity/EntityFieldManager.php b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
index a0fff7e..d6e70ee 100644
--- a/core/lib/Drupal/Core/Entity/EntityFieldManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityFieldManager.php
@@ -346,7 +346,7 @@ protected function buildBundleFieldDefinitions($entity_type_id, $bundle, array $
 
     // Load base field overrides from configuration. These take precedence over
     // base field overrides returned above.
-    $base_field_override_ids = array_map(function($field_name) use ($entity_type_id, $bundle) {
+    $base_field_override_ids = array_map(function ($field_name) use ($entity_type_id, $bundle) {
       return $entity_type_id . '.' . $bundle . '.' . $field_name;
     }, array_keys($base_field_definitions));
     $base_field_overrides = $this->entityTypeManager->getStorage('base_field_override')->loadMultiple($base_field_override_ids);
diff --git a/core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php b/core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php
index 3f7a6a6..7a03092 100644
--- a/core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php
+++ b/core/lib/Drupal/Core/Entity/KeyValueStore/Query/Query.php
@@ -50,7 +50,7 @@ public function execute() {
     foreach ($this->sort as $sort) {
       $direction = $sort['direction'] == 'ASC' ? -1 : 1;
       $field = $sort['field'];
-      uasort($result, function($a, $b) use ($field, $direction) {
+      uasort($result, function ($a, $b) use ($field, $direction) {
         return ($a[$field] <= $b[$field]) ? $direction : -$direction;
       });
     }
diff --git a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
index 70a3b4e..fdc7289 100644
--- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
+++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
@@ -296,13 +296,13 @@ public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $s
    */
   public function getDedicatedTableNames() {
     $table_mapping = $this;
-    $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) {
+    $definitions = array_filter($this->fieldStorageDefinitions, function ($definition) use ($table_mapping) {
       return $table_mapping->requiresDedicatedTableStorage($definition);
     });
-    $data_tables = array_map(function($definition) use ($table_mapping) {
+    $data_tables = array_map(function ($definition) use ($table_mapping) {
       return $table_mapping->getDedicatedDataTableName($definition);
     }, $definitions);
-    $revision_tables = array_map(function($definition) use ($table_mapping) {
+    $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));
diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
index a18a3c5..d180381 100644
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
@@ -1529,7 +1529,7 @@ 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) {
+            $specifier_columns = array_map(function ($item) {
               return is_string($item) ? $item : reset($item);
             }, $specifier);
             if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
@@ -1580,7 +1580,7 @@ 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) {
+            $specifier_columns = array_map(function ($item) {
               return is_string($item) ? $item : reset($item);
             }, $specifier);
             if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
diff --git a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
index 447b918..75ea5fd 100644
--- a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
@@ -93,7 +93,7 @@ public function onController(FilterControllerEvent $event) {
     // See \Symfony\Component\HttpKernel\HttpKernel::handleRaw().
     $arguments = $this->controllerResolver->getArguments($event->getRequest(), $controller);
 
-    $event->setController(function() use ($controller, $arguments) {
+    $event->setController(function () use ($controller, $arguments) {
       return $this->wrapControllerExecutionInRenderContext($controller, $arguments);
     });
   }
@@ -118,7 +118,7 @@ public function onController(FilterControllerEvent $event) {
   protected function wrapControllerExecutionInRenderContext($controller, array $arguments) {
     $context = new RenderContext();
 
-    $response = $this->renderer->executeInRenderContext($context, function() use ($controller, $arguments) {
+    $response = $this->renderer->executeInRenderContext($context, function () use ($controller, $arguments) {
       // Now call the actual controller, just like HttpKernel does.
       return call_user_func_array($controller, $arguments);
     });
diff --git a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
index 5442d15..8d588d4 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
@@ -176,7 +176,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
    */
   protected function getDatabaseErrors(array $database, $settings_file) {
     $errors = install_database_errors($database, $settings_file);
-    $form_errors = array_filter($errors, function($value) {
+    $form_errors = array_filter($errors, function ($value) {
       // Errors keyed by something other than an integer already are linked to
       // form elements.
       return is_int($value);
diff --git a/core/lib/Drupal/Core/Mail/MailManager.php b/core/lib/Drupal/Core/Mail/MailManager.php
index 6de2dd8..6a092c9 100644
--- a/core/lib/Drupal/Core/Mail/MailManager.php
+++ b/core/lib/Drupal/Core/Mail/MailManager.php
@@ -169,7 +169,7 @@ public function mail($module, $key, $to, $langcode, $params = [], $reply = NULL,
     // attachments. Therefore we perform mailing inside its own render context,
     // to ensure it doesn't leak into the render context for the HTTP response
     // to the current request.
-    return $this->renderer->executeInRenderContext(new RenderContext(), function() use ($module, $key, $to, $langcode, $params, $reply, $send) {
+    return $this->renderer->executeInRenderContext(new RenderContext(), function () use ($module, $key, $to, $langcode, $params, $reply, $send) {
       return $this->doMail($module, $key, $to, $langcode, $params, $reply, $send);
     });
   }
diff --git a/core/lib/Drupal/Core/Render/Element/Checkboxes.php b/core/lib/Drupal/Core/Render/Element/Checkboxes.php
index 3663cd5..35611fd 100644
--- a/core/lib/Drupal/Core/Render/Element/Checkboxes.php
+++ b/core/lib/Drupal/Core/Render/Element/Checkboxes.php
@@ -139,7 +139,7 @@ public static function getCheckedCheckboxes(array $input) {
     //
     // @see \Drupal\Core\Render\Element\Checkboxes::valueCallback()
     // @see https://www.w3.org/TR/html401/interact/forms.html#checkbox
-    $checked = array_filter($input, function($value) {
+    $checked = array_filter($input, function ($value) {
       return $value !== 0;
     });
     return array_keys($checked);
diff --git a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
index c76a972..5966668 100644
--- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
+++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php
@@ -139,7 +139,7 @@ public function renderResponse(array $main_content, Request $request, RouteMatch
     // RendererInterface::render() instead of RendererInterface::renderRoot().
     // @see \Drupal\Core\Render\HtmlResponseAttachmentsProcessor.
     $render_context = new RenderContext();
-    $this->renderer->executeInRenderContext($render_context, function() use (&$html) {
+    $this->renderer->executeInRenderContext($render_context, function () use (&$html) {
       // RendererInterface::render() renders the $html render array and updates
       // it in place. We don't care about the return value (which is just
       // $html['#markup']), but about the resulting render array.
@@ -216,7 +216,7 @@ protected function prepare(array $main_content, Request $request, RouteMatchInte
       // ::renderResponse().
       // @todo Remove this once https://www.drupal.org/node/2359901 lands.
       if (!empty($main_content)) {
-        $this->renderer->executeInRenderContext(new RenderContext(), function() use (&$main_content) {
+        $this->renderer->executeInRenderContext(new RenderContext(), function () use (&$main_content) {
           if (isset($main_content['#cache']['keys'])) {
             // Retain #title, otherwise, dynamically generated titles would be
             // missing for controllers whose entire returned render array is
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 584f79f..5038851 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -309,7 +309,7 @@ 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) {
+      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.");
diff --git a/core/lib/Drupal/Core/Routing/RouteCompiler.php b/core/lib/Drupal/Core/Routing/RouteCompiler.php
index e4aef43..9c430f6 100644
--- a/core/lib/Drupal/Core/Routing/RouteCompiler.php
+++ b/core/lib/Drupal/Core/Routing/RouteCompiler.php
@@ -130,7 +130,7 @@ public static function getPathWithoutDefaults(Route $route) {
 
     // Remove placeholders with default values from the outline, so that they
     // will still match.
-    $remove = array_map(function($a) {
+    $remove = array_map(function ($a) {
       return '/{' . $a . '}';
     }, array_keys($defaults));
     $path = str_replace($remove, '', $path);
diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php
index 520a8be..377efe6 100644
--- a/core/lib/Drupal/Core/Template/TwigExtension.php
+++ b/core/lib/Drupal/Core/Template/TwigExtension.php
@@ -610,7 +610,7 @@ public function safeJoin(\Twig_Environment $env, $value, $glue = '') {
       $value = iterator_to_array($value, FALSE);
     }
 
-    return implode($glue, array_map(function($item) use ($env) {
+    return implode($glue, array_map(function ($item) use ($env) {
       // If $item is not marked safe then it will be escaped.
       return $this->escapeFilter($env, $item, 'html', NULL, TRUE);
     }, (array) $value));
diff --git a/core/lib/Drupal/Core/Update/UpdateRegistry.php b/core/lib/Drupal/Core/Update/UpdateRegistry.php
index bb0b91f..b24ac67 100644
--- a/core/lib/Drupal/Core/Update/UpdateRegistry.php
+++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php
@@ -225,7 +225,7 @@ public function getModuleUpdateFunctions($module_name) {
     $this->scanExtensionsAndLoadUpdateFiles();
     $all_functions = $this->getAvailableUpdateFunctions();
 
-    return array_filter($all_functions, function($function_name) use ($module_name) {
+    return array_filter($all_functions, function ($function_name) use ($module_name) {
       list($function_module_name, ) = explode("_{$this->updateType}_", $function_name);
       return $function_module_name === $module_name;
     });
@@ -254,7 +254,7 @@ protected function scanExtensionsAndLoadUpdateFiles() {
   public function filterOutInvokedUpdatesByModule($module) {
     $existing_update_functions = $this->keyValue->get('existing_updates', []);
 
-    $remaining_update_functions = array_filter($existing_update_functions, function($function_name) use ($module) {
+    $remaining_update_functions = array_filter($existing_update_functions, function ($function_name) use ($module) {
       return strpos($function_name, "{$module}_{$this->updateType}_") !== 0;
     });
 
diff --git a/core/lib/Drupal/Core/Utility/LinkGenerator.php b/core/lib/Drupal/Core/Utility/LinkGenerator.php
index 8367556..5c6288d 100644
--- a/core/lib/Drupal/Core/Utility/LinkGenerator.php
+++ b/core/lib/Drupal/Core/Utility/LinkGenerator.php
@@ -112,7 +112,7 @@ public function generate($text, Url $url) {
     }
 
     // Ensure that query values are strings.
-    array_walk($variables['options']['query'], function(&$value) {
+    array_walk($variables['options']['query'], function (&$value) {
       if ($value instanceof MarkupInterface) {
         $value = (string) $value;
       }
diff --git a/core/modules/action/src/Plugin/Action/GotoAction.php b/core/modules/action/src/Plugin/Action/GotoAction.php
index 44e871b..13a9a0d 100644
--- a/core/modules/action/src/Plugin/Action/GotoAction.php
+++ b/core/modules/action/src/Plugin/Action/GotoAction.php
@@ -92,7 +92,7 @@ public function execute($object = NULL) {
       $url = $this->unroutedUrlAssembler->assemble($uri, $options);
     }
     $response = new RedirectResponse($url);
-    $listener = function($event) use ($response) {
+    $listener = function ($event) use ($response) {
       $event->setResponse($response);
     };
     // Add the listener to the event dispatcher.
diff --git a/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php b/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
index 9b88e43..6c6793a 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
@@ -86,7 +86,7 @@ public function fetch(FeedInterface $feed) {
       $actual_uri = NULL;
       $response = $this->httpClientFactory->fromOptions([
         'allow_redirects' => [
-          'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
+          'on_redirect' => function (RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
             $actual_uri = (string) $uri;
           }
         ],
diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
index 525ef34..4e8200b 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
@@ -141,7 +141,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
     ];
 
     $lengths = [0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000];
-    $options = array_map(function($length) {
+    $options = array_map(function ($length) {
       return ($length == 0) ? t('Unlimited') : $this->formatPlural($length, '1 character', '@count characters');
     }, array_combine($lengths, $lengths));
 
diff --git a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
index d43822c..92d1a86 100644
--- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
+++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
@@ -374,7 +374,7 @@ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholde
     }
     ksort($placeholder_positions, SORT_NUMERIC);
     $this->assertEqual(array_keys($expected_big_pipe_placeholders), array_values($placeholder_positions));
-    $placeholders = array_map(function(NodeElement $element) {
+    $placeholders = array_map(function (NodeElement $element) {
       return $element->getAttribute('data-big-pipe-placeholder-id');
     }, $this->cssSelect('[data-big-pipe-placeholder-id]'));
     $this->assertEqual(count($expected_big_pipe_placeholders), count(array_unique($placeholders)));
diff --git a/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php b/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
index 0b34f84..5cea220 100644
--- a/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
+++ b/core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
@@ -84,7 +84,7 @@ public function testBlockFilter() {
    * @return NodeElement[]
    */
   protected function filterVisibleElements(array $elements) {
-    $elements = array_filter($elements, function(NodeElement $element) {
+    $elements = array_filter($elements, function (NodeElement $element) {
       return $element->isVisible();
     });
     return $elements;
diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc
index 8a8f68c..f9316c6 100644
--- a/core/modules/ckeditor/ckeditor.admin.inc
+++ b/core/modules/ckeditor/ckeditor.admin.inc
@@ -66,7 +66,7 @@ function template_preprocess_ckeditor_settings_toolbar(&$variables) {
 
   $rtl = $language_interface->getDirection() === LanguageInterface::DIRECTION_RTL ? '_rtl' : '';
 
-  $build_button_item = function($button, $rtl) {
+  $build_button_item = function ($button, $rtl) {
     // Value of the button item.
     if (isset($button['image_alternative' . $rtl])) {
       $value = $button['image_alternative' . $rtl];
diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
index 9a04ce7..6c6990b 100644
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php
@@ -126,7 +126,7 @@ public function getConfig(Editor $editor) {
    * {@inheritdoc}
    */
   public function getButtons() {
-    $button = function($name, $direction = 'ltr') {
+    $button = function ($name, $direction = 'ltr') {
       // In the markup below, we mostly use the name (which may include spaces),
       // but in one spot we use it as a CSS class, so strip spaces.
       // Note: this uses str_replace() instead of Html::cleanCssIdentifier()
@@ -420,8 +420,8 @@ protected function generateACFSettings(Editor $editor) {
     }
     // Generate setting that accurately reflects allowed tags and attributes.
     else {
-      $get_attribute_values = function($attribute_values, $allowed_values) {
-        $values = array_keys(array_filter($attribute_values, function($value) use ($allowed_values) {
+      $get_attribute_values = function ($attribute_values, $allowed_values) {
+        $values = array_keys(array_filter($attribute_values, function ($value) use ($allowed_values) {
           if ($allowed_values) {
             return $value !== FALSE;
           }
@@ -532,7 +532,7 @@ protected function generateACFSettings(Editor $editor) {
           // getConfig() method, and override the JavaScript at
           // Drupal.editors.ckeditor to somehow make validation of values for
           // attributes other than "class" and "style" work.
-          $allowed_attributes = array_filter($attributes, function($value) {
+          $allowed_attributes = array_filter($attributes, function ($value) {
             return $value !== FALSE;
           });
           if (count($allowed_attributes)) {
@@ -567,7 +567,7 @@ protected function generateACFSettings(Editor $editor) {
           // implies that all of its possible attribute values are disallowed,
           // thus we must look at the disallowed attribute values on allowed
           // attributes.
-          $disallowed_attributes = array_filter($attributes, function($value) {
+          $disallowed_attributes = array_filter($attributes, function ($value) {
             return $value === FALSE;
           });
           if (count($disallowed_attributes)) {
diff --git a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
index 255691f..49ab1b3 100644
--- a/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
@@ -194,7 +194,7 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor
       }
     }
     // Get a list of all buttons that are provided by all plugins.
-    $all_buttons = array_reduce($this->ckeditorPluginManager->getButtons(), function($result, $item) {
+    $all_buttons = array_reduce($this->ckeditorPluginManager->getButtons(), function ($result, $item) {
       return array_merge($result, array_keys($item));
     }, []);
     // Build a fake Editor object, which we'll use to generate JavaScript
@@ -418,7 +418,7 @@ public function buildContentsCssJSSetting(Editor $editor) {
     ];
     $this->moduleHandler->alter('ckeditor_css', $css, $editor);
     // Get a list of all enabled plugins' iframe instance CSS files.
-    $plugins_css = array_reduce($this->ckeditorPluginManager->getCssFiles($editor), function($result, $item) {
+    $plugins_css = array_reduce($this->ckeditorPluginManager->getCssFiles($editor), function ($result, $item) {
       return array_merge($result, array_values($item));
     }, []);
     $css = array_merge($css, $plugins_css);
diff --git a/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php b/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
index ce3411c..1ec2227 100644
--- a/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/tests/src/Functional/CKEditorAdminTest.php
@@ -179,7 +179,7 @@ public function testExistingFormat() {
     // JavaScript's drupalSettings, and Unicode-escaped) is correctly rendered.
     $this->drupalGet('admin/config/content/formats/manage/filtered_html');
     // Create function to encode HTML as we expect it in drupalSettings.
-    $json_encode = function($html) {
+    $json_encode = function ($html) {
       return trim(Json::encode($html), '"');
     };
     // Check the Button separator.
diff --git a/core/modules/ckeditor/tests/src/Functional/CKEditorToolbarButtonTest.php b/core/modules/ckeditor/tests/src/Functional/CKEditorToolbarButtonTest.php
index e8d0e2d..c9df846 100644
--- a/core/modules/ckeditor/tests/src/Functional/CKEditorToolbarButtonTest.php
+++ b/core/modules/ckeditor/tests/src/Functional/CKEditorToolbarButtonTest.php
@@ -67,7 +67,7 @@ public function testImageButtonDisplay() {
     $this->drupalGet('admin/config/content/formats/manage/full_html');
 
     // Check if any image button is loaded in CKEditor json.
-    $json_encode = function($html) {
+    $json_encode = function ($html) {
       return trim(Json::encode($html), '"');
     };
     $markup = $json_encode(file_url_transform_relative(file_create_url('core/modules/ckeditor/js/plugins/drupalimage/icons/drupalimage.png')));
diff --git a/core/modules/ckeditor/tests/src/FunctionalJavascript/AjaxCssTest.php b/core/modules/ckeditor/tests/src/FunctionalJavascript/AjaxCssTest.php
index f011554..b15433d 100644
--- a/core/modules/ckeditor/tests/src/FunctionalJavascript/AjaxCssTest.php
+++ b/core/modules/ckeditor/tests/src/FunctionalJavascript/AjaxCssTest.php
@@ -55,7 +55,7 @@ public function testCkeditorAjaxAddCss() {
     // but not the iframe.
     $page->pressButton('Add CSS to inline CKEditor instance');
 
-    $result = $page->waitFor(10, function() use ($style_color) {
+    $result = $page->waitFor(10, function () use ($style_color) {
       return ($this->getEditorStyle('edit-inline', 'color') == $style_color)
         && ($this->getEditorStyle('edit-iframe-value', 'color') != $style_color);
     });
@@ -70,7 +70,7 @@ public function testCkeditorAjaxAddCss() {
     // but not the main body.
     $page->pressButton('Add CSS to iframe CKEditor instance');
 
-    $result = $page->waitFor(10, function() use ($style_color) {
+    $result = $page->waitFor(10, function () use ($style_color) {
       return ($this->getEditorStyle('edit-inline', 'color') != $style_color)
         && ($this->getEditorStyle('edit-iframe-value', 'color') == $style_color);
     });
diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
index ba3bfad..04a12b8 100644
--- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php
+++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
@@ -136,7 +136,7 @@ public function testSendMailMessages(MessageInterface $message, AccountInterface
     $this->mailManager->expects($this->any())
       ->method('mail')
       ->willReturnCallback(
-        function($module, $key, $to, $langcode, $params, $from) use (&$results) {
+        function ($module, $key, $to, $langcode, $params, $from) use (&$results) {
           $result = array_shift($results);
           $this->assertEquals($module, $result['module']);
           $this->assertEquals($key, $result['key']);
diff --git a/core/modules/content_moderation/src/Form/EntityModerationForm.php b/core/modules/content_moderation/src/Form/EntityModerationForm.php
index 85e18d1..6d768c8 100644
--- a/core/modules/content_moderation/src/Form/EntityModerationForm.php
+++ b/core/modules/content_moderation/src/Form/EntityModerationForm.php
@@ -71,7 +71,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ContentEn
     $transitions = $this->validation->getValidTransitions($entity, $this->currentUser());
 
     // Exclude self-transitions.
-    $transitions = array_filter($transitions, function(Transition $transition) use ($current_state) {
+    $transitions = array_filter($transitions, function (Transition $transition) use ($current_state) {
       return $transition->to()->id() != $current_state;
     });
 
diff --git a/core/modules/content_moderation/src/StateTransitionValidation.php b/core/modules/content_moderation/src/StateTransitionValidation.php
index fc09e5e..01b2ad8 100644
--- a/core/modules/content_moderation/src/StateTransitionValidation.php
+++ b/core/modules/content_moderation/src/StateTransitionValidation.php
@@ -42,7 +42,7 @@ public function getValidTransitions(ContentEntityInterface $entity, AccountInter
     $workflow = $this->moderationInfo->getWorkflowForEntity($entity);
     $current_state = $entity->moderation_state->value ? $workflow->getTypePlugin()->getState($entity->moderation_state->value) : $workflow->getTypePlugin()->getInitialState($entity);
 
-    return array_filter($current_state->getTransitions(), function(Transition $transition) use ($workflow, $user) {
+    return array_filter($current_state->getTransitions(), function (Transition $transition) use ($workflow, $user) {
       return $user->hasPermission('use ' . $workflow->id() . ' transition ' . $transition->id());
     });
   }
diff --git a/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php b/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
index b45b34e..c32123d 100644
--- a/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
@@ -52,7 +52,7 @@ public function testStateFieldFormatter($field_value, $formatter_settings, $expe
     ]);
     $entity->save();
 
-    $field_output = $this->container->get('renderer')->executeInRenderContext(new RenderContext(), function() use ($entity, $formatter_settings) {
+    $field_output = $this->container->get('renderer')->executeInRenderContext(new RenderContext(), function () use ($entity, $formatter_settings) {
       return $entity->moderation_state->view($formatter_settings);
     });
 
diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
index e88d9ac..fa5fd1c 100644
--- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
+++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSyncUnitTest.php
@@ -181,19 +181,19 @@ public function testMultipleSyncedValues() {
     // their delta.
     $delta_callbacks = [
       // Continuous field values: all values are equal.
-      function($delta) {
+      function ($delta) {
         return TRUE;
       },
       // Alternated field values: only the even ones are equal.
-      function($delta) {
+      function ($delta) {
         return $delta % 2 !== 0;
       },
       // Sparse field values: only the "middle" ones are equal.
-      function($delta) {
+      function ($delta) {
         return $delta === 1 || $delta === 2;
       },
       // Sparse field values: only the "extreme" ones are equal.
-      function($delta) {
+      function ($delta) {
         return $delta === 0 || $delta === 3;
       },
     ];
diff --git a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
index c68ae48..a70a232 100644
--- a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
   public function testEditorFileReferenceFilter() {
     $filter = $this->filters['editor_file_reference'];
 
-    $test = function($input) use ($filter) {
+    $test = function ($input) use ($filter) {
       return $filter->process($input, 'und');
     };
 
diff --git a/core/modules/field/src/Tests/Views/FieldUITest.php b/core/modules/field/src/Tests/Views/FieldUITest.php
index ce8208b..851b7bd 100644
--- a/core/modules/field/src/Tests/Views/FieldUITest.php
+++ b/core/modules/field/src/Tests/Views/FieldUITest.php
@@ -57,7 +57,7 @@ public function testHandlerUI() {
 
     // Tests the available formatter options.
     $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-options-type']);
-    $options = array_map(function($item) {
+    $options = array_map(function ($item) {
       return (string) $item->attributes()->value[0];
     }, $result);
     // @todo Replace this sort by assertArray once it's in.
@@ -111,7 +111,7 @@ public function testHandlerUIAggregation() {
     // Test the click sort column options.
     // Tests the available formatter options.
     $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-options-click-sort-column']);
-    $options = array_map(function($item) {
+    $options = array_map(function ($item) {
       return (string) $item->attributes()->value[0];
     }, $result);
     sort($options, SORT_STRING);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
index 3ad61ee..5c8b55a 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
@@ -194,7 +194,7 @@ public function testTextFieldInstances() {
     // message with the required steps to fix this.
     $migration = $this->getMigration('d7_field_instance');
     $messages = $migration->getIdMap()->getMessageIterator()->fetchAll();
-    $errors = array_map(function($message) {
+    $errors = array_map(function ($message) {
       return $message->message;
     }, $messages);
     $this->assertCount(8, $errors);
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
index b53fa80..272af0e 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php
@@ -149,7 +149,7 @@ public function testTextFields() {
     // message with the required steps to fix this.
     $migration = $this->getMigration('d7_field');
     $messages = $migration->getIdMap()->getMessageIterator()->fetchAll();
-    $errors = array_map(function($message) {
+    $errors = array_map(function ($message) {
       return $message->message;
     }, $messages);
     sort($errors);
diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
index 0a91862..06eed1f 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
@@ -125,7 +125,7 @@ public function getRegionOptions() {
    */
   protected function getFieldDefinitions() {
     $context = $this->displayContext;
-    return array_filter($this->entityManager->getFieldDefinitions($this->entity->getTargetEntityTypeId(), $this->entity->getTargetBundle()), function(FieldDefinitionInterface $field_definition) use ($context) {
+    return array_filter($this->entityManager->getFieldDefinitions($this->entity->getTargetEntityTypeId(), $this->entity->getTargetBundle()), function (FieldDefinitionInterface $field_definition) use ($context) {
       return $field_definition->isDisplayConfigurable($context);
     });
   }
diff --git a/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/core/modules/field_ui/src/Tests/ManageDisplayTest.php
index 7ba011e..750a327 100644
--- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php
+++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php
@@ -85,7 +85,7 @@ public function testFormatterUI() {
 
     // Check whether formatter weights are respected.
     $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']);
-    $options = array_map(function($item) {
+    $options = array_map(function ($item) {
       return (string) $item->attributes()->value[0];
     }, $result);
     $expected_options = [
@@ -247,7 +247,7 @@ public function testWidgetUI() {
 
     // Check whether widget weights are respected.
     $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']);
-    $options = array_map(function($item) {
+    $options = array_map(function ($item) {
       return (string) $item->attributes()->value[0];
     }, $result);
     $expected_options = [
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 845cc5d..b08fad5 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1208,7 +1208,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state)
 
     // Value callback expects FIDs to be keys.
     $files = array_filter($files);
-    $fids = array_map(function($file) {
+    $fids = array_map(function ($file) {
       return $file->id();
     }, $files);
 
diff --git a/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php
index 06c2221..17c34bf 100644
--- a/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php
+++ b/core/modules/file/src/Plugin/migrate/source/d6/UploadInstance.php
@@ -25,7 +25,7 @@ protected function initializeIterator() {
       ->fields('nt', ['type'])
       ->execute()
       ->fetchCol();
-    $variables = array_map(function($type) {
+    $variables = array_map(function ($type) {
       return 'upload_' . $type;
     }, $node_types);
 
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
index 2997596..6a393df 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
index 8503eae..9478b32 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
index 4a8f1ce..06695e4 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
index 28d0842..70f6d60 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
index 15d86a1..e774382 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
index 61fda03..fd11800 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
     $this->migration = $migration->reveal();
diff --git a/core/modules/filter/src/Element/ProcessedText.php b/core/modules/filter/src/Element/ProcessedText.php
index 6e2b3ec..5c7a212 100644
--- a/core/modules/filter/src/Element/ProcessedText.php
+++ b/core/modules/filter/src/Element/ProcessedText.php
@@ -82,7 +82,7 @@ public static function preRenderText($element) {
       return $element;
     }
 
-    $filter_must_be_applied = function(FilterInterface $filter) use ($filter_types_to_skip) {
+    $filter_must_be_applied = function (FilterInterface $filter) use ($filter_types_to_skip) {
       $enabled = $filter->status === TRUE;
       $type = $filter->getType();
       // Prevent FilterInterface::TYPE_HTML_RESTRICTOR from being skipped.
diff --git a/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php
index 9dbaa62..c757512 100644
--- a/core/modules/filter/src/Entity/FilterFormat.php
+++ b/core/modules/filter/src/Entity/FilterFormat.php
@@ -269,7 +269,7 @@ public function getFilterTypes() {
    */
   public function getHtmlRestrictions() {
     // Ignore filters that are disabled or don't have HTML restrictions.
-    $filters = array_filter($this->filters()->getAll(), function($filter) {
+    $filters = array_filter($this->filters()->getAll(), function ($filter) {
       if (!$filter->status) {
         return FALSE;
       }
@@ -286,7 +286,7 @@ public function getHtmlRestrictions() {
       // From the set of remaining filters (they were filtered by array_filter()
       // above), collect the list of tags and attributes that are allowed by all
       // filters, i.e. the intersection of all allowed tags and attributes.
-      $restrictions = array_reduce($filters, function($restrictions, $filter) {
+      $restrictions = array_reduce($filters, function ($restrictions, $filter) {
         $new_restrictions = $filter->getHTMLRestrictions();
 
         // The first filter with HTML restrictions provides the initial set.
diff --git a/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestRestrictTagsAndAttributes.php b/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestRestrictTagsAndAttributes.php
index 352506e..c6f6200 100644
--- a/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestRestrictTagsAndAttributes.php
+++ b/core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestRestrictTagsAndAttributes.php
@@ -22,7 +22,7 @@ class FilterTestRestrictTagsAndAttributes extends FilterBase {
    * {@inheritdoc}
    */
   public function process($text, $langcode) {
-    $allowed_tags = array_filter($this->settings['restrictions']['allowed'], function($value) {
+    $allowed_tags = array_filter($this->settings['restrictions']['allowed'], function ($value) {
       return is_array($value) || (bool) $value !== FALSE;
     });
     return new FilterProcessResult(Xss::filter($text, array_keys($allowed_tags)));
diff --git a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
index cf72bbe..7b0c029 100644
--- a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
+++ b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php
@@ -44,7 +44,7 @@ protected function setUp() {
   public function testAlignFilter() {
     $filter = $this->filters['filter_align'];
 
-    $test = function($input) use ($filter) {
+    $test = function ($input) use ($filter) {
       return $filter->process($input, 'und');
     };
 
@@ -101,7 +101,7 @@ public function testCaptionFilter() {
     $renderer = \Drupal::service('renderer');
     $filter = $this->filters['filter_caption'];
 
-    $test = function($input) use ($filter, $renderer) {
+    $test = function ($input) use ($filter, $renderer) {
       return $renderer->executeInRenderContext(new RenderContext(), function () use ($input, $filter) {
         return $filter->process($input, 'und');
       });
@@ -266,7 +266,7 @@ public function testAlignAndCaptionFilters() {
     $align_filter = $this->filters['filter_align'];
     $caption_filter = $this->filters['filter_caption'];
 
-    $test = function($input) use ($align_filter, $caption_filter, $renderer) {
+    $test = function ($input) use ($align_filter, $caption_filter, $renderer) {
       return $renderer->executeInRenderContext(new RenderContext(), function () use ($input, $align_filter, $caption_filter) {
         return $caption_filter->process($align_filter->process($input, 'und'), 'und');
       });
diff --git a/core/modules/language/src/HttpKernel/PathProcessorLanguage.php b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php
index c4af20c..8bb4f83 100644
--- a/core/modules/language/src/HttpKernel/PathProcessorLanguage.php
+++ b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php
@@ -147,7 +147,7 @@ protected function initProcessors($scope) {
 
     // Sort the processors list, so that their functions are called in the
     // order specified by the weight of the methods.
-    uksort($this->processors[$scope], function ($method_id_a, $method_id_b) use($weights) {
+    uksort($this->processors[$scope], function ($method_id_a, $method_id_b) use ($weights) {
       $a_weight = $weights[$method_id_a];
       $b_weight = $weights[$method_id_b];
 
diff --git a/core/modules/language/src/LanguageServiceProvider.php b/core/modules/language/src/LanguageServiceProvider.php
index 4060f75..a7e934a 100644
--- a/core/modules/language/src/LanguageServiceProvider.php
+++ b/core/modules/language/src/LanguageServiceProvider.php
@@ -70,7 +70,7 @@ protected function isMultilingual() {
     //   and caching. This might prove difficult as this is called before the
     //   container has finished building.
     $config_storage = BootstrapConfigStorageFactory::get();
-    $config_ids = array_filter($config_storage->listAll($prefix), function($config_id) use ($prefix) {
+    $config_ids = array_filter($config_storage->listAll($prefix), function ($config_id) use ($prefix) {
       return $config_id != $prefix . LanguageInterface::LANGCODE_NOT_SPECIFIED && $config_id != $prefix . LanguageInterface::LANGCODE_NOT_APPLICABLE;
     });
     return count($config_ids) > 1;
diff --git a/core/modules/language/src/Plugin/Condition/Language.php b/core/modules/language/src/Plugin/Condition/Language.php
index a5b3d41..52a89a2 100644
--- a/core/modules/language/src/Plugin/Condition/Language.php
+++ b/core/modules/language/src/Plugin/Condition/Language.php
@@ -104,7 +104,7 @@ public function summary() {
     $language_list = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL);
     $selected = $this->configuration['langcodes'];
     // Reduce the language list to an array of language names.
-    $language_names = array_reduce($language_list, function(&$result, $item) use ($selected) {
+    $language_names = array_reduce($language_list, function (&$result, $item) use ($selected) {
       // If the current item of the $language_list array is one of the selected
       // languages, add it to the $results array.
       if (!empty($selected[$item->getId()])) {
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
index 77d35e0..896c15c 100644
--- a/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
@@ -44,7 +44,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
index 7dea25e..494aa02 100644
--- a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
@@ -43,7 +43,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/cckfield/LinkCckTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/cckfield/LinkCckTest.php
index f549a0d..7029d72 100644
--- a/core/modules/link/tests/src/Unit/Plugin/migrate/cckfield/LinkCckTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/cckfield/LinkCckTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
index 645e3e1..1b07d1e 100644
--- a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to mergeProcessOfProperty().
     $migration->mergeProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc
index fade172..b509c25 100644
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -240,7 +240,7 @@ function locale_translation_http_check($uri) {
     $actual_uri = NULL;
     $response = \Drupal::service('http_client_factory')->fromOptions([
       'allow_redirects' => [
-        'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
+        'on_redirect' => function (RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
           $actual_uri = (string) $request_uri;
         }
       ],
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index 571f7d2..a2816e3 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -67,7 +67,7 @@ function locale_translation_get_projects(array $project_names = []) {
       locale_translation_build_projects();
     }
     $projects = \Drupal::service('locale.project')->getAll();
-    array_walk($projects, function(&$project) {
+    array_walk($projects, function (&$project) {
       $project = (object) $project;
     });
   }
@@ -329,7 +329,7 @@ function locale_cron_fill_queue() {
   // Determine which project+language should be updated.
   $last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24;
   $projects = \Drupal::service('locale.project')->getAll();
-  $projects = array_filter($projects, function($project) {
+  $projects = array_filter($projects, function ($project) {
     return $project['status'] == 1;
   });
   $files = db_select('locale_file', 'f')
diff --git a/core/modules/menu_ui/src/MenuForm.php b/core/modules/menu_ui/src/MenuForm.php
index 0bee996..cb27b25 100644
--- a/core/modules/menu_ui/src/MenuForm.php
+++ b/core/modules/menu_ui/src/MenuForm.php
@@ -221,7 +221,7 @@ protected function buildOverviewForm(array &$form, FormStateInterface $form_stat
     $this->getRequest()->attributes->set('_menu_admin', FALSE);
 
     // Determine the delta; the number of weights to be made available.
-    $count = function(array $tree) {
+    $count = function (array $tree) {
       $sum = function ($carry, MenuLinkTreeElement $item) {
         return $carry + $item->count();
       };
diff --git a/core/modules/migrate/src/Plugin/MigrationPluginManager.php b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
index f3b75bc..b572bb5 100644
--- a/core/modules/migrate/src/Plugin/MigrationPluginManager.php
+++ b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
@@ -64,7 +64,7 @@ public function __construct(ModuleHandlerInterface $module_handler, CacheBackend
    */
   protected function getDiscovery() {
     if (!isset($this->discovery)) {
-      $directories = array_map(function($directory) {
+      $directories = array_map(function ($directory) {
         return [$directory . '/migration_templates', $directory . '/migrations'];
       }, $this->moduleHandler->getModuleDirectories());
 
@@ -125,7 +125,7 @@ public function createInstances($migration_id, array $configuration = []) {
    *   An array of migration objects with the given tag.
    */
   public function createInstancesByTag($tag) {
-    $migrations = array_filter($this->getDefinitions(), function($migration) use ($tag) {
+    $migrations = array_filter($this->getDefinitions(), function ($migration) use ($tag) {
       return !empty($migration['migration_tags']) && in_array($tag, $migration['migration_tags']);
     });
     return $this->createInstances(array_keys($migrations));
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
index 76c9419..d7058b1 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
@@ -39,7 +39,7 @@ protected function getDatabase(array $source_data) {
         ->createTable($table, [
           // SQLite uses loose affinity typing, so it's OK for every field to
           // be a text field.
-          'fields' => array_map(function() {
+          'fields' => array_map(function () {
             return ['type' => 'text'];
           }, $pilot),
         ]);
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
index 2f1a49e..51e61d4 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
@@ -230,7 +230,7 @@ protected function mockFailure($migration, array $row, $status = MigrateIdMapInt
       $migration = $this->getMigration($migration);
     }
     /** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
-    $destination = array_map(function() {
+    $destination = array_map(function () {
       return NULL;
     }, $migration->getDestinationPlugin()->getIds());
     $row = new Row($row, $migration->getSourcePlugin()->getIds());
diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
index cbac03a..20d7662 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
@@ -61,12 +61,12 @@ protected function getMigration() {
     // on the test class and use a return callback.
     $migration->expects($this->any())
       ->method('getStatus')
-      ->willReturnCallback(function() {
+      ->willReturnCallback(function () {
         return $this->migrationStatus;
       });
     $migration->expects($this->any())
       ->method('setStatus')
-      ->willReturnCallback(function($status) {
+      ->willReturnCallback(function ($status) {
         $this->migrationStatus = $status;
       });
 
@@ -147,7 +147,7 @@ protected function getDatabase(array $database_contents, $connection_options = [
   protected function createSchemaFromRow(array $row) {
     // SQLite uses loose ("affinity") typing, so it is OK for every column to be
     // a text field.
-    $fields = array_map(function() {
+    $fields = array_map(function () {
       return ['type' => 'text'];
     }, $row);
     return ['fields' => $fields];
diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php
index b878935..59ce8b6 100644
--- a/core/modules/migrate/tests/src/Unit/process/GetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php
@@ -48,7 +48,7 @@ public function testTransformSourceArray() {
     $this->plugin->setSource(['test1', 'test2']);
     $this->row->expects($this->exactly(2))
       ->method('getSourceProperty')
-      ->will($this->returnCallback(function ($argument)  use ($map) {
+      ->will($this->returnCallback(function ($argument) use ($map) {
         return $map[$argument];
       }));
     $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty');
@@ -81,7 +81,7 @@ public function testTransformSourceArrayAt() {
     $this->plugin->setSource(['test1', '@@test2', '@@test3', 'test4']);
     $this->row->expects($this->exactly(4))
       ->method('getSourceProperty')
-      ->will($this->returnCallback(function ($argument)  use ($map) {
+      ->will($this->returnCallback(function ($argument) use ($map) {
         return $map[$argument];
       }));
     $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty');
diff --git a/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php b/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
index 9c5ee58..6be7801 100644
--- a/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php
@@ -114,7 +114,7 @@ public function testUntranslatable() {
     $message = $this->prophesize(MigrateMessageInterface::class);
     // Match the expected message. Can't use default argument types, because
     // we need to convert to string from TranslatableMarkup.
-    $argument = Argument::that(function($msg) {
+    $argument = Argument::that(function ($msg) {
       return strpos((string) $msg, "This entity type does not support translation") !== FALSE;
     });
     $message->display($argument, Argument::any())
diff --git a/core/modules/quickedit/quickedit.module b/core/modules/quickedit/quickedit.module
index d569de2..4e32170 100644
--- a/core/modules/quickedit/quickedit.module
+++ b/core/modules/quickedit/quickedit.module
@@ -77,7 +77,7 @@ function quickedit_library_info_alter(&$libraries, $extension) {
     $theme = Drupal::config('system.theme')->get('admin');
 
     // First let the base theme modify the library, then the actual theme.
-    $alter_library = function(&$library, $theme) use (&$alter_library) {
+    $alter_library = function (&$library, $theme) use (&$alter_library) {
       if (isset($theme) && $theme_path = drupal_get_path('theme', $theme)) {
         $info = system_get_info('theme', $theme);
         // Recurse to process base theme(s) first.
diff --git a/core/modules/responsive_image/responsive_image.post_update.php b/core/modules/responsive_image/responsive_image.post_update.php
index 33fec71..de9424f 100644
--- a/core/modules/responsive_image/responsive_image.post_update.php
+++ b/core/modules/responsive_image/responsive_image.post_update.php
@@ -13,7 +13,7 @@
  */
 function responsive_image_post_update_recreate_dependencies() {
   $displays = EntityViewDisplay::loadMultiple();
-  array_walk($displays, function(EntityViewDisplayInterface $entity_view_display) {
+  array_walk($displays, function (EntityViewDisplayInterface $entity_view_display) {
     $old_dependencies = $entity_view_display->getDependencies();
     $new_dependencies = $entity_view_display->calculateDependencies()->getDependencies();
     if ($old_dependencies !== $new_dependencies) {
diff --git a/core/modules/rest/src/Plugin/views/display/RestExport.php b/core/modules/rest/src/Plugin/views/display/RestExport.php
index cd96195..7aeb3fc 100644
--- a/core/modules/rest/src/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/src/Plugin/views/display/RestExport.php
@@ -407,7 +407,7 @@ public function execute() {
    */
   public function render() {
     $build = [];
-    $build['#markup'] = $this->renderer->executeInRenderContext(new RenderContext(), function() {
+    $build['#markup'] = $this->renderer->executeInRenderContext(new RenderContext(), function () {
       return $this->view->style_plugin->render();
     });
 
diff --git a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
index 175db17..c511877 100644
--- a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
+++ b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
@@ -184,7 +184,7 @@ public function getFieldKeyAlias($id) {
    *   A regular one dimensional array of values.
    */
   protected static function extractFromOptionsArray($key, $options) {
-    return array_map(function($item) use ($key) {
+    return array_map(function ($item) use ($key) {
       return isset($item[$key]) ? $item[$key] : NULL;
     }, $options);
   }
diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
index ad1a0b3..a154587 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -667,7 +667,7 @@ public function testFieldapiField() {
 
     $result = Json::decode($this->drupalGet('test/serialize/node-field', ['query' => ['_format' => 'json']]));
     $this->assertEqual(count($result[2]['body']), $node->body->count(), 'Expected count of values');
-    $this->assertEqual($result[2]['body'], array_map(function($item) {
+    $this->assertEqual($result[2]['body'], array_map(function ($item) {
       return $item['value'];
     }, $node->body->getValue()), 'Expected raw body values found.');
   }
diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php
index 7916a90..5e829f6 100644
--- a/core/modules/serialization/src/Normalizer/NormalizerBase.php
+++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php
@@ -36,7 +36,7 @@ public function supportsNormalization($data, $format = NULL) {
 
     $supported = (array) $this->supportedInterfaceOrClass;
 
-    return (bool) array_filter($supported, function($name) use ($data) {
+    return (bool) array_filter($supported, function ($name) use ($data) {
       return $data instanceof $name;
     });
   }
@@ -56,7 +56,7 @@ public function supportsDenormalization($data, $type, $format = NULL) {
 
     $supported = (array) $this->supportedInterfaceOrClass;
 
-    $subclass_check = function($name) use ($type) {
+    $subclass_check = function ($name) use ($type) {
       return (class_exists($name) || interface_exists($name)) && is_subclass_of($type, $name, TRUE);
     };
 
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 2213e93..0e0ea2a 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -345,7 +345,7 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
   }
   else {
     // Double escape namespaces so they'll work in a regexp.
-    $escaped_test_classnames = array_map(function($class) {
+    $escaped_test_classnames = array_map(function ($class) {
       return addslashes($class);
     }, $unescaped_test_classnames);
 
diff --git a/core/modules/simpletest/src/AssertContentTrait.php b/core/modules/simpletest/src/AssertContentTrait.php
index 5a6c8c0..3c33e58 100644
--- a/core/modules/simpletest/src/AssertContentTrait.php
+++ b/core/modules/simpletest/src/AssertContentTrait.php
@@ -874,7 +874,7 @@ protected function assertThemeOutput($callback, array $variables = [], $expected
     // The string cast is necessary because theme functions return
     // MarkupInterface objects. This means we can assert that $expected
     // matches the theme output without having to worry about 0 == ''.
-    $output = (string) $renderer->executeInRenderContext(new RenderContext(), function() use ($callback, $variables) {
+    $output = (string) $renderer->executeInRenderContext(new RenderContext(), function () use ($callback, $variables) {
       return \Drupal::theme()->render($callback, $variables);
     });
     $this->verbose(
diff --git a/core/modules/system/src/SystemManager.php b/core/modules/system/src/SystemManager.php
index d2e0344..3fc4182 100644
--- a/core/modules/system/src/SystemManager.php
+++ b/core/modules/system/src/SystemManager.php
@@ -110,7 +110,7 @@ public function listRequirements() {
 
     // Check run-time requirements and status information.
     $requirements = $this->moduleHandler->invokeAll('requirements', ['runtime']);
-    uasort($requirements, function($a, $b) {
+    uasort($requirements, function ($a, $b) {
       if (!isset($a['weight'])) {
         if (!isset($b['weight'])) {
           return strcasecmp($a['title'], $b['title']);
diff --git a/core/modules/system/src/Tests/Ajax/CommandsTest.php b/core/modules/system/src/Tests/Ajax/CommandsTest.php
index 6970cc3..6ae97ae 100644
--- a/core/modules/system/src/Tests/Ajax/CommandsTest.php
+++ b/core/modules/system/src/Tests/Ajax/CommandsTest.php
@@ -124,7 +124,7 @@ public function testAjaxCommands() {
    * Regression test: Settings command exists regardless of JS aggregation.
    */
   public function testAttachedSettings() {
-    $assert = function($message) {
+    $assert = function ($message) {
       $response = new AjaxResponse();
       $response->setAttachments([
         'library' => ['core/drupalSettings'],
diff --git a/core/modules/system/src/Tests/Bootstrap/ErrorContainer.php b/core/modules/system/src/Tests/Bootstrap/ErrorContainer.php
index 9ee814f..e8afa4b 100644
--- a/core/modules/system/src/Tests/Bootstrap/ErrorContainer.php
+++ b/core/modules/system/src/Tests/Bootstrap/ErrorContainer.php
@@ -15,7 +15,7 @@ class ErrorContainer extends Container {
   public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
     if ($id === 'http_kernel') {
       // Enforce a recoverable error.
-      $callable = function(ErrorContainer $container) {
+      $callable = function (ErrorContainer $container) {
       };
       $callable(1);
     }
diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php
index d72f8e5..1092e1a 100644
--- a/core/modules/system/src/Tests/Common/UrlTest.php
+++ b/core/modules/system/src/Tests/Common/UrlTest.php
@@ -168,7 +168,7 @@ public function testLinkRenderArrayText() {
     $l = \Drupal::l('foo', Url::fromUri('https://www.drupal.org'));
 
     // Test a renderable array passed to the link generator.
-    $renderer->executeInRenderContext(new RenderContext(), function() use ($renderer, $l) {
+    $renderer->executeInRenderContext(new RenderContext(), function () use ($renderer, $l) {
       $renderable_text = ['#markup' => 'foo'];
       $l_renderable_text = \Drupal::l($renderable_text, Url::fromUri('https://www.drupal.org'));
       $this->assertEqual($l_renderable_text, $l);
diff --git a/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php b/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php
index 03ae366..dd526b8 100644
--- a/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php
+++ b/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php
@@ -56,7 +56,7 @@ public function generateWarnings($collect_errors = FALSE) {
    * Generate fatals to test the error handler.
    */
   public function generateFatals() {
-    $function = function(array $test) {
+    $function = function (array $test) {
     };
 
     $function("test-string");
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
index 684e0be..3637369 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php
@@ -42,7 +42,7 @@ protected function setUp() {
    * Tests EntityViewController.
    */
   public function testEntityViewController() {
-    $get_label_markup = function($label) {
+    $get_label_markup = function ($label) {
       return '<h1 class="page-title">
             <div class="field field--name-name field--type-string field--label-hidden field__item">' . $label . '</div>
       </h1>';
diff --git a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
index 5fcc5cd..2fe4a83 100644
--- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
+++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
@@ -191,7 +191,7 @@ public function testBuildWithTwoPathElements() {
 
     $this->requestMatcher->expects($this->exactly(1))
       ->method('matchRequest')
-      ->will($this->returnCallback(function(Request $request) use ($route_1) {
+      ->will($this->returnCallback(function (Request $request) use ($route_1) {
         if ($request->getPathInfo() == '/example') {
           return [
             RouteObjectInterface::ROUTE_NAME => 'example',
@@ -227,7 +227,7 @@ public function testBuildWithThreePathElements() {
 
     $this->requestMatcher->expects($this->exactly(2))
       ->method('matchRequest')
-      ->will($this->returnCallback(function(Request $request) use ($route_1, $route_2) {
+      ->will($this->returnCallback(function (Request $request) use ($route_1, $route_2) {
         if ($request->getPathInfo() == '/example/bar') {
           return [
             RouteObjectInterface::ROUTE_NAME => 'example_bar',
@@ -357,7 +357,7 @@ public function testBuildWithUserPath() {
 
     $this->requestMatcher->expects($this->exactly(1))
       ->method('matchRequest')
-      ->will($this->returnCallback(function(Request $request) use ($route_1) {
+      ->will($this->returnCallback(function (Request $request) use ($route_1) {
         if ($request->getPathInfo() == '/user/1') {
           return [
             RouteObjectInterface::ROUTE_NAME => 'user_page',
diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
index c2014d5..2423668 100644
--- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php
@@ -137,7 +137,7 @@ public function providerTestBuildCacheability() {
       ]
     ];
 
-    $get_built_element = function(MenuLinkTreeElement $element) {
+    $get_built_element = function (MenuLinkTreeElement $element) {
       $return = [
         'attributes' => new Attribute(),
         'title' => $element->link->getTitle(),
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
index 5e646e0..981969f 100644
--- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
index de88d7d..974fc15 100644
--- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php b/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php
index 73d7e2e..2d2c655 100644
--- a/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php
+++ b/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
index 44fb04e..a49b9af 100644
--- a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php
index 6f2d967..0847c12 100644
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
index 52418fe..8363989 100644
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
     // process pipeline created by the plugin, we need to ensure that
     // getProcess() always returns the last input to setProcessOfProperty().
     $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array'))
-      ->will(function($arguments) use ($migration) {
+      ->will(function ($arguments) use ($migration) {
         $migration->getProcess()->willReturn($arguments[1]);
       });
 
diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php
index 0e7ef0e..0226f94 100644
--- a/core/modules/user/src/Entity/Role.php
+++ b/core/modules/user/src/Entity/Role.php
@@ -173,7 +173,7 @@ public function preSave(EntityStorageInterface $storage) {
 
     if (!isset($this->weight) && ($roles = $storage->loadMultiple())) {
       // Set a role weight to make this new role last.
-      $max = array_reduce($roles, function($max, $role) {
+      $max = array_reduce($roles, function ($max, $role) {
         return $max > $role->weight ? $max : $role->weight;
       });
       $this->weight = $max + 1;
diff --git a/core/modules/user/src/Plugin/views/argument/Uid.php b/core/modules/user/src/Plugin/views/argument/Uid.php
index b2a022a..5efbecd 100644
--- a/core/modules/user/src/Plugin/views/argument/Uid.php
+++ b/core/modules/user/src/Plugin/views/argument/Uid.php
@@ -54,7 +54,7 @@ public static function create(ContainerInterface $container, array $configuratio
    *   A list of usernames.
    */
   public function titleQuery() {
-    return array_map(function($account) {
+    return array_map(function ($account) {
       return $account->label();
     }, $this->storage->loadMultiple($this->value));
   }
diff --git a/core/modules/user/src/Tests/Views/HandlerFilterUserNameTest.php b/core/modules/user/src/Tests/Views/HandlerFilterUserNameTest.php
index c4f7065..4f7d4cd 100644
--- a/core/modules/user/src/Tests/Views/HandlerFilterUserNameTest.php
+++ b/core/modules/user/src/Tests/Views/HandlerFilterUserNameTest.php
@@ -169,7 +169,7 @@ public function testExposedFilter() {
     }
 
     // Pass in just valid user IDs in the entity_autocomplete target_id format.
-    $options['query']['uid'] = array_map(function($account) {
+    $options['query']['uid'] = array_map(function ($account) {
       return ['target_id' => $account->id()];
     }, $this->accounts);
 
diff --git a/core/modules/views/src/Controller/ViewAjaxController.php b/core/modules/views/src/Controller/ViewAjaxController.php
index 2e0ea18..4aefdab 100644
--- a/core/modules/views/src/Controller/ViewAjaxController.php
+++ b/core/modules/views/src/Controller/ViewAjaxController.php
@@ -181,7 +181,7 @@ public function ajaxView(Request $request) {
         $view->dom_id = $dom_id;
 
         $context = new RenderContext();
-        $preview = $this->renderer->executeInRenderContext($context, function() use ($view, $display_id, $args) {
+        $preview = $this->renderer->executeInRenderContext($context, function () use ($view, $display_id, $args) {
           return $view->preview($display_id, $args);
         });
         if (!$context->isEmpty()) {
diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php
index 49b0af8..59e9196 100644
--- a/core/modules/views/src/EntityViewsData.php
+++ b/core/modules/views/src/EntityViewsData.php
@@ -307,7 +307,7 @@ public function getViewsData() {
 
     // Add the entity type key to each table generated.
     $entity_type_id = $this->entityType->id();
-    array_walk($data, function(&$table_data) use ($entity_type_id){
+    array_walk($data, function (&$table_data) use ($entity_type_id) {
       $table_data['table']['entity type'] = $entity_type_id;
     });
 
diff --git a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
index 6cf6ba2..5d3f42a 100644
--- a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
+++ b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
@@ -42,7 +42,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
     ] + $options;
 
     // Add the HTTP status code, so it's easier for people to find it.
-    array_walk($options, function($title, $code) use(&$options) {
+    array_walk($options, function ($title, $code) use (&$options) {
       $options[$code] = $this->t('@code (@title)', ['@code' => $code, '@title' => $title]);
     });
 
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index ab056f5..612b0fc 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1469,7 +1469,7 @@ public function execute(ViewExecutable $view) {
 
         // Setup the result row objects.
         $view->result = iterator_to_array($result);
-        array_walk($view->result, function(ResultRow $row, $index) {
+        array_walk($view->result, function (ResultRow $row, $index) {
           $row->index = $index;
         });
 
diff --git a/core/modules/views/src/Views.php b/core/modules/views/src/Views.php
index 014beae..dd241f7 100644
--- a/core/modules/views/src/Views.php
+++ b/core/modules/views/src/Views.php
@@ -512,7 +512,7 @@ public static function getPluginTypes($type = NULL) {
       throw new \Exception('Invalid plugin type used. Valid types are "plugin" or "handler".');
     }
 
-    return array_keys(array_filter(static::$plugins, function($plugin_type) use ($type) {
+    return array_keys(array_filter(static::$plugins, function ($plugin_type) use ($type) {
       return $plugin_type == $type;
     }));
   }
diff --git a/core/modules/views/tests/src/Kernel/ModuleTest.php b/core/modules/views/tests/src/Kernel/ModuleTest.php
index 68612b7..9fe9df6 100644
--- a/core/modules/views/tests/src/Kernel/ModuleTest.php
+++ b/core/modules/views/tests/src/Kernel/ModuleTest.php
@@ -158,13 +158,13 @@ public function testLoadFunctions() {
     $this->assertEquals(array_keys($all_views), array_keys(Views::getAllViews()), 'Views::getAllViews works as expected.');
 
     // Test Views::getEnabledViews().
-    $expected_enabled = array_filter($all_views, function($view) {
+    $expected_enabled = array_filter($all_views, function ($view) {
       return views_view_is_enabled($view);
     });
     $this->assertEquals(array_keys($expected_enabled), array_keys(Views::getEnabledViews()), 'Expected enabled views returned.');
 
     // Test Views::getDisabledViews().
-    $expected_disabled = array_filter($all_views, function($view) {
+    $expected_disabled = array_filter($all_views, function ($view) {
       return views_view_is_disabled($view);
     });
     $this->assertEquals(array_keys($expected_disabled), array_keys(Views::getDisabledViews()), 'Expected disabled views returned.');
diff --git a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
index a2bec23..ace4204 100644
--- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
@@ -164,7 +164,7 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) {
     $this->pass('Test arguments');
 
     // Custom assert for a single result row.
-    $single_entity_assertions = function(array $build, EntityInterface $entity) {
+    $single_entity_assertions = function (array $build, EntityInterface $entity) {
       $this->setRawContent($build['#markup']);
 
       $result = $this->cssSelect('div.views-row');
diff --git a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
index b49d0c32..7390214 100644
--- a/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewExecutableTest.php
@@ -432,7 +432,7 @@ public function testValidate() {
 
     $count = 0;
     foreach ($view->displayHandlers as $id => $display) {
-      $match = function($value) use ($display) {
+      $match = function ($value) use ($display) {
         return strpos($value, $display->display['display_title']) !== FALSE;
       };
       $this->assertTrue(array_filter($validate[$id], $match), format_string('Error message found for @id display', ['@id' => $id]));
diff --git a/core/modules/views/tests/src/Kernel/ViewsHooksTest.php b/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
index aceda8f..b61a5d9 100644
--- a/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
+++ b/core/modules/views/tests/src/Kernel/ViewsHooksTest.php
@@ -106,7 +106,7 @@ public function testViewsPreRenderViewsFormViewsForm() {
       ],
       '#substitutions' => ['#value' => []],
     ];
-    $element = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function() use ($element) {
+    $element = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($element) {
       return views_pre_render_views_form_views_form($element);
     });
     $this->setRawContent((string) $element['output']['#markup']);
diff --git a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
index 822239f..d65acaa 100644
--- a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
+++ b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
@@ -74,7 +74,7 @@ protected function setUp() {
     $this->renderer = $this->getMock('\Drupal\Core\Render\RendererInterface');
     $this->renderer->expects($this->any())
       ->method('render')
-      ->will($this->returnCallback(function(array &$elements) {
+      ->will($this->returnCallback(function (array &$elements) {
         $elements['#attached'] = [];
         return isset($elements['#markup']) ? $elements['#markup'] : '';
       }));
diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
index eefc541..7da93a6 100644
--- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -612,7 +612,7 @@ public function testDataTableFields() {
 
     $table_mapping->expects($this->any())
       ->method('getFieldTableName')
-      ->willReturnCallback(function($field) {
+      ->willReturnCallback(function ($field) {
         if ($field == 'uuid') {
           return 'entity_test_mul';
         }
@@ -786,7 +786,7 @@ public function testRevisionTableFields() {
 
     $table_mapping->expects($this->any())
       ->method('getFieldTableName')
-      ->willReturnCallback(function($field) {
+      ->willReturnCallback(function ($field) {
         if ($field == 'uuid') {
           return 'entity_test_mulrev';
         }
diff --git a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
index 76f0cd8..927551f 100644
--- a/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
+++ b/core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php
@@ -101,7 +101,7 @@ public function testOnAlterRoutes() {
     // should only call the second display.
     $display_1->expects($this->once())
       ->method('collectRoutes')
-      ->willReturnCallback(function() use ($collection) {
+      ->willReturnCallback(function () use ($collection) {
         $collection->add('views.test_id.page_1', new Route('test_route', ['_controller' => 'Drupal\views\Routing\ViewPageController']));
         return ['test_id.page_1' => 'views.test_id.page_1'];
       });
@@ -111,7 +111,7 @@ public function testOnAlterRoutes() {
 
     $display_2->expects($this->once())
       ->method('collectRoutes')
-      ->willReturnCallback(function() use ($collection) {
+      ->willReturnCallback(function () use ($collection) {
         $collection->add('views.test_id.page_2', new Route('test_route', ['_controller' => 'Drupal\views\Routing\ViewPageController']));
         return ['test_id.page_2' => 'views.test_id.page_2'];
       });
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index e8ff8d7..a7bcf81 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -548,7 +548,7 @@ public function testRenderAsLinkWithPathAndTokens($path, $tokens, $link_html) {
       '#type' => 'inline_template',
       '#template' => 'test-path/' . explode('/', $path)[1],
       '#context' => ['foo' => 123],
-      '#post_render' => [function() {}],
+      '#post_render' => [function () {}],
     ];
 
     $this->renderer->expects($this->once())
@@ -612,7 +612,7 @@ public function testRenderAsExternalLinkWithPathAndTokens($path, $tokens, $link_
       '#type' => 'inline_template',
       '#template' => $path,
       '#context' => ['foo' => $context['context_path']],
-      '#post_render' => [function() {}],
+      '#post_render' => [function () {}],
     ];
 
     $this->renderer->expects($this->once())
@@ -740,7 +740,7 @@ public function testElementClassesWithTokens() {
       '#type' => 'inline_template',
       '#template' => $test_class,
       '#context' => $tokens,
-      '#post_render' => [function() {}],
+      '#post_render' => [function () {}],
     ];
 
     // We're not testing the token rendering itself, just that the function
diff --git a/core/modules/views/tests/src/Unit/ViewExecutableTest.php b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
index e0aada0..b6d3c91 100644
--- a/core/modules/views/tests/src/Unit/ViewExecutableTest.php
+++ b/core/modules/views/tests/src/Unit/ViewExecutableTest.php
@@ -362,7 +362,7 @@ public function testAddHandler() {
     foreach (['field', 'filter', 'argument', 'sort'] as $handler_type) {
       $display->expects($this->atLeastOnce())
         ->method('setOption')
-        ->with($this->callback(function($argument) {
+        ->with($this->callback(function ($argument) {
           return $argument;
         }), [
           'test_field' => [
@@ -405,7 +405,7 @@ public function testAddHandlerWithEntityField() {
     foreach (['field', 'filter', 'argument', 'sort'] as $handler_type) {
       $display->expects($this->atLeastOnce())
         ->method('setOption')
-        ->with($this->callback(function($argument) {
+        ->with($this->callback(function ($argument) {
           return $argument;
         }), [
           'test_field' => [
diff --git a/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php b/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
index 2289f23..b08938c 100644
--- a/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsDataHelperTest.php
@@ -97,7 +97,7 @@ public function testFetchFields() {
     foreach ($handler_types as $handler_type) {
       $fields = $data_helper->fetchFields('views_test_data', $handler_type);
       $expected_keys = $expected[$handler_type];
-      array_walk($expected_keys, function(&$item) {
+      array_walk($expected_keys, function (&$item) {
         $item = "views_test_data.$item";
       });
       $this->assertEquals($expected_keys, array_keys($fields), "Handlers of type $handler_type are not listed as expected");
@@ -108,7 +108,7 @@ public function testFetchFields() {
       $fields = $data_helper->fetchFields('views_test_data', 'area', FALSE, $sub_type);
 
       $expected_keys = $expected[$sub_type];
-      array_walk($expected_keys, function(&$item) {
+      array_walk($expected_keys, function (&$item) {
         $item = "views_test_data.$item";
       });
       $this->assertEquals($expected_keys, array_keys($fields), "Sub_type $sub_type is not filtered as expected.");
diff --git a/core/modules/views/views.post_update.php b/core/modules/views/views.post_update.php
index e09159e..b77d5ce 100644
--- a/core/modules/views/views.post_update.php
+++ b/core/modules/views/views.post_update.php
@@ -128,7 +128,7 @@ function views_post_update_cleanup_duplicate_views_data() {
  */
 function views_post_update_field_formatter_dependencies() {
   $views = View::loadMultiple();
-  array_walk($views, function(View $view) {
+  array_walk($views, function (View $view) {
     $view->save();
   });
 }
@@ -138,7 +138,7 @@ function views_post_update_field_formatter_dependencies() {
  */
 function views_post_update_taxonomy_index_tid() {
   $views = View::loadMultiple();
-  array_walk($views, function(View $view) {
+  array_walk($views, function (View $view) {
     $old_dependencies = $view->getDependencies();
     $new_dependencies = $view->calculateDependencies()->getDependencies();
     if ($old_dependencies !== $new_dependencies) {
@@ -152,7 +152,7 @@ function views_post_update_taxonomy_index_tid() {
  */
 function views_post_update_serializer_dependencies() {
   $views = View::loadMultiple();
-  array_walk($views, function(View $view) {
+  array_walk($views, function (View $view) {
     $old_dependencies = $view->getDependencies();
     $new_dependencies = $view->calculateDependencies()->getDependencies();
     if ($old_dependencies !== $new_dependencies) {
@@ -209,7 +209,7 @@ function views_post_update_revision_metadata_fields() {
   // The table names are fixed automatically in
   // \Drupal\views\Entity\View::preSave(), so we just need to re-save all views.
   $views = View::loadMultiple();
-  array_walk($views, function(View $view) {
+  array_walk($views, function (View $view) {
     $view->save();
   });
 }
diff --git a/core/modules/views/views.views.inc b/core/modules/views/views.views.inc
index ed6fa07..526f350 100644
--- a/core/modules/views/views.views.inc
+++ b/core/modules/views/views.views.inc
@@ -266,7 +266,7 @@ function views_entity_field_label($entity_type, $field_name) {
   // Sort the field labels by it most used label and return the most used one.
   // If the counts are equal, sort by the label to ensure the result is
   // deterministic.
-  uksort($label_counter, function($a, $b) use ($label_counter) {
+  uksort($label_counter, function ($a, $b) use ($label_counter) {
     if ($label_counter[$a] === $label_counter[$b]) {
       return strcmp($a, $b);
     }
diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php
index 0a04000..ec0c655 100644
--- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php
+++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php
@@ -176,7 +176,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     $view->getStandardButtons($form, $form_state, 'views_ui_add_handler_form', $this->t('Add and configure @types', ['@types' => $ltitle]));
 
     // Remove the default submit function.
-    $form['actions']['submit']['#submit'] = array_filter($form['actions']['submit']['#submit'], function($var) {
+    $form['actions']['submit']['#submit'] = array_filter($form['actions']['submit']['#submit'], function ($var) {
       return !(is_array($var) && isset($var[1]) && $var[1] == 'standardSubmit');
     });
     $form['actions']['submit']['#submit'][] = [$view, 'submitItemAdd'];
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
index af2c4e2..7291dc2 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
@@ -166,7 +166,7 @@ public function testMenuOptions() {
     unset($menu_options['@attributes']);
 
     // Convert array to make the next assertion possible.
-    $menu_options = array_map(function($element) {
+    $menu_options = array_map(function ($element) {
       return $element->getText();
     }, $menu_options);
 
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
index 03325ce..cab99bd 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
@@ -118,7 +118,7 @@ public function testFilterViewsListing() {
    * @return array
    */
   protected function filterVisibleElements($elements) {
-    $elements = array_filter($elements, function($element) {
+    $elements = array_filter($elements, function ($element) {
       return $element->isVisible();
     });
     return $elements;
diff --git a/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php b/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php
index 0062580..aab488a 100644
--- a/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php
+++ b/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php
@@ -30,7 +30,7 @@ public function getStates($state_ids = NULL) {
       'bet' => new State($this, 'bet', 'Bet'),
       'raise' => new State($this, 'raise', 'Raise'),
       'fold' => new State($this, 'fold', 'Fold'),
-    ], function($state) use ($state_ids) {
+    ], function ($state) use ($state_ids) {
         return is_array($state_ids) ? in_array($state->id(), $state_ids) : TRUE;
     });
   }
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 5b07e1e..49d4583 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -218,6 +218,23 @@
   <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose">
     <severity>0</severity>
   </rule>
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine">
+    <severity>0</severity>
+  </rule>
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace">
+    <severity>0</severity>
+  </rule>
+  <!-- Standard yet to be finalized on this (https://www.drupal.org/node/1539712). -->
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing">
+    <severity>0</severity>
+  </rule>
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.Indent">
+    <severity>0</severity>
+  </rule>
+  <rule ref="Squiz.Functions.MultiLineFunctionDeclaration.CloseBracketLine">
+    <severity>0</severity>
+  </rule>
   <rule ref="Squiz.PHP.LowercasePHPFunctions"/>
   <rule ref="Squiz.Strings.ConcatenationSpacing">
     <properties>
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
index 81d379f..10ae701 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
@@ -64,7 +64,7 @@ function isAjaxing(instance) {
   public function waitForElement($selector, $locator, $timeout = 10000) {
     $page = $this->session->getPage();
 
-    $result = $page->waitFor($timeout / 1000, function() use ($page, $selector, $locator) {
+    $result = $page->waitFor($timeout / 1000, function () use ($page, $selector, $locator) {
       return $page->find($selector, $locator);
     });
 
@@ -90,7 +90,7 @@ public function waitForElement($selector, $locator, $timeout = 10000) {
   public function waitForElementVisible($selector, $locator, $timeout = 10000) {
     $page = $this->session->getPage();
 
-    $result = $page->waitFor($timeout / 1000, function() use ($page, $selector, $locator) {
+    $result = $page->waitFor($timeout / 1000, function () use ($page, $selector, $locator) {
       $element = $page->find($selector, $locator);
       if (!empty($element) && $element->isVisible()) {
         return $element;
diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
index 911d523..a375db7 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
@@ -83,7 +83,7 @@ public function testUpdateHookN() {
     $select->range(0, 5);
     $select->fields('watchdog', ['message']);
 
-    $container_cannot_be_saved_messages = array_filter(iterator_to_array($select->execute()), function($row) {
+    $container_cannot_be_saved_messages = array_filter(iterator_to_array($select->execute()), function ($row) {
       return strpos($row->message, 'Container cannot be saved to cache.') !== FALSE;
     });
     $this->assertEqual([], $container_cannot_be_saved_messages);
diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
index 4c54487..66005de 100644
--- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
@@ -54,7 +54,7 @@ public function testDrupalGetFilename() {
     $non_existing_module = uniqid("", TRUE);
 
     // Set a custom error handler so we can ignore the file not found error.
-    set_error_handler(function($severity, $message, $file, $line) {
+    set_error_handler(function ($severity, $message, $file, $line) {
       // Skip error handling if this is a "file not found" error.
       if (strstr($message, 'is missing from the file system:')) {
         \Drupal::state()->set('get_filename_test_triggered_error', TRUE);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
index b430872..cedf685 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php
@@ -247,24 +247,24 @@ public function testAutocreateApi() {
       ->create(['name' => $this->randomString()]);
 
     // Test content entity autocreation.
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->set('user_id', $user);
     });
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->set('user_id', $user, FALSE);
     });
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->user_id->setValue($user);
     });
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->user_id[0]->get('entity')->setValue($user);
     });
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->user_id->setValue(['entity' => $user, 'target_id' => NULL]);
     });
     try {
       $message = 'Setting both the entity and an invalid target_id property fails.';
-      $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+      $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
         $user->save();
         $entity->user_id->setValue(['entity' => $user, 'target_id' => $this->generateRandomEntityId()]);
       });
@@ -273,32 +273,32 @@ public function testAutocreateApi() {
     catch (\InvalidArgumentException $e) {
       $this->pass($message);
     }
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->user_id = $user;
     });
-    $this->assertUserAutocreate($entity, function(EntityInterface $entity, UserInterface $user) {
+    $this->assertUserAutocreate($entity, function (EntityInterface $entity, UserInterface $user) {
       $entity->user_id->entity = $user;
     });
 
     // Test config entity autocreation.
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->set('user_role', $role);
     });
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->set('user_role', $role, FALSE);
     });
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->user_role->setValue($role);
     });
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->user_role[0]->get('entity')->setValue($role);
     });
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->user_role->setValue(['entity' => $role, 'target_id' => NULL]);
     });
     try {
       $message = 'Setting both the entity and an invalid target_id property fails.';
-      $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+      $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
         $role->save();
         $entity->user_role->setValue(['entity' => $role, 'target_id' => $this->generateRandomEntityId(TRUE)]);
       });
@@ -307,10 +307,10 @@ public function testAutocreateApi() {
     catch (\InvalidArgumentException $e) {
       $this->pass($message);
     }
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->user_role = $role;
     });
-    $this->assertUserRoleAutocreate($entity, function(EntityInterface $entity, RoleInterface $role) {
+    $this->assertUserRoleAutocreate($entity, function (EntityInterface $entity, RoleInterface $role) {
       $entity->user_role->entity = $role;
     });
 
diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
index 033451ac..cd0afa2 100644
--- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php
@@ -111,7 +111,7 @@ public function testCreateLinksInMenu() {
     $parameters = new MenuTreeParameters();
     $tree = $this->linkTree->load('mock', $parameters);
 
-    $count = function(array $tree) {
+    $count = function (array $tree) {
       $sum = function ($carry, MenuLinkTreeElement $item) {
         return $carry + $item->count();
       };
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
index a3492ed..4c6e22a 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/DiscoveryTestBase.php
@@ -71,7 +71,7 @@ public function testDiscoveryInterface() {
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
   protected function assertDefinitionIdentical(array $definition, array $expected_definition) {
-    $func = function (&$item){
+    $func = function (&$item) {
       if ($item instanceof TranslatableMarkup) {
         $item = (string) $item;
       }
diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
index c79f2cf..e3e3fae 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
@@ -399,7 +399,7 @@ public function testTypedDataListsFilter() {
     // Check that an all-pass filter leaves the list untouched.
     $value = ['zero', 'one'];
     $typed_data = $this->createTypedData(ListDataDefinition::create('string'), $value);
-    $typed_data->filter(function(TypedDataInterface $item) {
+    $typed_data->filter(function (TypedDataInterface $item) {
       return TRUE;
     });
     $this->assertEqual($typed_data->count(), 2);
@@ -411,7 +411,7 @@ public function testTypedDataListsFilter() {
     // Check that a none-pass filter empties the list.
     $value = ['zero', 'one'];
     $typed_data = $this->createTypedData(ListDataDefinition::create('string'), $value);
-    $typed_data->filter(function(TypedDataInterface $item) {
+    $typed_data->filter(function (TypedDataInterface $item) {
       return FALSE;
     });
     $this->assertEqual($typed_data->count(), 0);
@@ -419,7 +419,7 @@ public function testTypedDataListsFilter() {
     // Check that filtering correctly renumbers elements.
     $value = ['zero', 'one', 'two'];
     $typed_data = $this->createTypedData(ListDataDefinition::create('string'), $value);
-    $typed_data->filter(function(TypedDataInterface $item) {
+    $typed_data->filter(function (TypedDataInterface $item) {
       return $item->getValue() !== 'one';
     });
     $this->assertEqual($typed_data->count(), 2);
diff --git a/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
index 0b627c5..02d6384 100644
--- a/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
+++ b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
@@ -15,7 +15,7 @@
    */
   public function coreModuleListDataProvider() {
     $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator(__DIR__ . '/../../../modules/')));
-    $module_names = array_map(function($path) {
+    $module_names = array_map(function ($path) {
       return str_replace(__DIR__ . '/../../../modules/', '', $path);
     }, $module_dirs);
     $modules_keyed = array_combine($module_names, $module_names);
diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php
index abdedd9..e7c79f3 100644
--- a/core/tests/Drupal/Tests/BrowserTestBase.php
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -1070,7 +1070,7 @@ protected function getHtmlOutputHeaders() {
    *   The formatted HTML string.
    */
   protected function formatHtmlOutputHeaders(array $headers) {
-    $flattened_headers = array_map(function($header) {
+    $flattened_headers = array_map(function ($header) {
       if (is_array($header)) {
         return implode(';', array_map('trim', $header));
       }
diff --git a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
index 208440b..f418244 100644
--- a/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
+++ b/core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
@@ -157,7 +157,7 @@ public function testAllCallable() {
       'strchr',
       [$this, 'callMe'],
       [__CLASS__, 'callMeStatic'],
-      function() {
+      function () {
         return TRUE;
       }
     ]));
@@ -166,7 +166,7 @@ function() {
       'strchr',
       [$this, 'callMe'],
       [__CLASS__, 'callMeStatic'],
-      function() {
+      function () {
         return TRUE;
       },
       "I'm not callable"
diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
index 7b8fc87..14a34c0 100644
--- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
+++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php
@@ -517,7 +517,7 @@ public function testGetForConfigurator() {
     $configurator = $this->prophesize('\Drupal\Tests\Component\DependencyInjection\MockConfiguratorInterface');
     $configurator->configureService(Argument::type('object'))
       ->shouldBeCalled(1)
-      ->will(function($args) use ($container) {
+      ->will(function ($args) use ($container) {
         $args[0]->setContainer($container);
       });
     $container->set('configurator', $configurator->reveal());
diff --git a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
index fffd26e..03d39d3 100644
--- a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
+++ b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php
@@ -64,7 +64,7 @@ protected function findPhpClasses($dir) {
   protected function assertNoCoreUsage($class_path) {
     $contents = file_get_contents($class_path);
     preg_match_all('/^.*Drupal\\\Core.*$/m', $contents, $matches);
-    $matches = array_filter($matches[0], function($line) {
+    $matches = array_filter($matches[0], function ($line) {
       // Filter references to @see as they don't really matter.
       return strpos($line, '@see') === FALSE;
     });
diff --git a/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php b/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
index e8d52bb..4760c19 100644
--- a/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
+++ b/core/tests/Drupal/Tests/Component/FileSystem/RegexDirectoryIteratorTest.php
@@ -21,7 +21,7 @@ public function testRegexDirectoryIterator(array $directory, $regex, array $expe
     $iterator = new RegexDirectoryIterator(vfsStream::url('root'), $regex);
 
     // Create an array of filenames to assert against.
-    $file_list = array_map(function(\SplFileInfo $file) {
+    $file_list = array_map(function (\SplFileInfo $file) {
       return $file->getFilename();
     }, array_values(iterator_to_array($iterator)));
 
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
index 1aa2a36..2ed15bb 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php
@@ -46,7 +46,7 @@ public function testGetDefinition($expected, $cached_definitions, $get_definitio
       $trait->expects($this->once())
         ->method('getDefinitions')
         // Use a callback method, so we can perform the side-effects.
-        ->willReturnCallback(function() use ($reflection_definitions, $trait, $get_definitions) {
+        ->willReturnCallback(function () use ($reflection_definitions, $trait, $get_definitions) {
           $reflection_definitions->setValue($trait, $get_definitions);
           return $get_definitions;
         });
diff --git a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
index 3d1a41d..7e8fbef 100644
--- a/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php
@@ -172,9 +172,7 @@ public function __construct($plugin_id) {
  */
 class ArgumentsMany {
 
-  public function __construct(
-  $configuration, $plugin_definition, $plugin_id, $foo = 'default_value', $what_am_i_doing_here = 'what_default'
-  ) {
+  public function __construct($configuration, $plugin_definition, $plugin_id, $foo = 'default_value', $what_am_i_doing_here = 'what_default') {
     // No-op.
   }
 
diff --git a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
index 0c92331..f15f14b 100644
--- a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php
@@ -41,22 +41,22 @@ public function providerTestGetArgument() {
 
     // Test an optional parameter with no provided value.
     $data[] = [
-      function($foo = 'foo') {}, [], [], [] , ['foo'],
+      function ($foo = 'foo') {}, [], [], [] , ['foo'],
     ];
 
     // Test an optional parameter with a provided value.
     $data[] = [
-      function($foo = 'foo') {}, ['foo' => 'bar'], [], [], ['bar'],
+      function ($foo = 'foo') {}, ['foo' => 'bar'], [], [], ['bar'],
     ];
 
     // Test with a provided value.
     $data[] = [
-      function($foo) {}, ['foo' => 'bar'], [], [], ['bar'],
+      function ($foo) {}, ['foo' => 'bar'], [], [], ['bar'],
     ];
 
     // Test with an explicitly NULL value.
     $data[] = [
-      function($foo) {}, [], ['foo' => NULL], [], [NULL],
+      function ($foo) {}, [], ['foo' => NULL], [], [NULL],
     ];
 
     // Test with a raw value that overrides the provided upcast value, since
@@ -64,7 +64,7 @@ function($foo) {}, [], ['foo' => NULL], [], [NULL],
     $scalars  = ['foo' => 'baz'];
     $objects = ['foo' => new \stdClass()];
     $data[] = [
-      function($foo) {}, $scalars, $objects, [], ['baz'],
+      function ($foo) {}, $scalars, $objects, [], ['baz'],
     ];
 
     return $data;
@@ -74,7 +74,7 @@ function($foo) {}, $scalars, $objects, [], ['baz'],
    * Tests getArgument() with an object.
    */
   public function testGetArgumentObject() {
-    $callable = function(\stdClass $object) {};
+    $callable = function (\stdClass $object) {};
 
     $object = new \stdClass();
     $arguments = (new ArgumentsResolver([], ['object' => $object], []))->getArguments($callable);
@@ -85,7 +85,7 @@ public function testGetArgumentObject() {
    * Tests getArgument() with a wildcard object for a parameter with a custom name.
    */
   public function testGetWildcardArgument() {
-    $callable = function(\stdClass $custom_name) {};
+    $callable = function (\stdClass $custom_name) {};
 
     $object = new \stdClass();
     $arguments = (new ArgumentsResolver([], [], [$object]))->getArguments($callable);
@@ -107,12 +107,12 @@ public function testGetArgumentOrder() {
     $wildcards = [$a3];
     $resolver = new ArgumentsResolver([], $objects, $wildcards);
 
-    $callable = function(Test1Interface $t1, TestClass $tc, Test2Interface $t2) {};
+    $callable = function (Test1Interface $t1, TestClass $tc, Test2Interface $t2) {};
     $arguments = $resolver->getArguments($callable);
     $this->assertSame([$a1, $a2, $a3], $arguments);
 
     // Test again, but with the arguments in a different order.
-    $callable = function(Test2Interface $t2, TestClass $tc, Test1Interface $t1) {};
+    $callable = function (Test2Interface $t2, TestClass $tc, Test1Interface $t1) {};
     $arguments = $resolver->getArguments($callable);
     $this->assertSame([$a3, $a2, $a1], $arguments);
   }
@@ -127,7 +127,7 @@ public function testGetWildcardArgumentNoTypehint() {
     $wildcards = [$a];
     $resolver = new ArgumentsResolver([], [], $wildcards);
 
-    $callable = function($route) {};
+    $callable = function ($route) {};
     $this->setExpectedException(\RuntimeException::class, 'requires a value for the "$route" argument.');
     $resolver->getArguments($callable);
   }
@@ -142,7 +142,7 @@ public function testGetArgumentRouteNoTypehintAndValue() {
     $scalars = ['route' => 'foo'];
     $resolver = new ArgumentsResolver($scalars, [], []);
 
-    $callable = function($route) {};
+    $callable = function ($route) {};
     $arguments = $resolver->getArguments($callable);
     $this->assertSame(['foo'], $arguments);
   }
@@ -155,7 +155,7 @@ public function testHandleNotUpcastedArgument() {
     $scalars = ['foo' => 'baz'];
     $resolver = new ArgumentsResolver($scalars, $objects, []);
 
-    $callable = function(\stdClass $foo) {};
+    $callable = function (\stdClass $foo) {};
     $this->setExpectedException(\RuntimeException::class, 'requires a value for the "$foo" argument.');
     $resolver->getArguments($callable);
   }
@@ -176,7 +176,7 @@ public function testHandleUnresolvedArgument($callable) {
    */
   public function providerTestHandleUnresolvedArgument() {
     $data = [];
-    $data[] = [function($foo) {}];
+    $data[] = [function ($foo) {}];
     $data[] = [[new TestClass(), 'access']];
     $data[] = ['Drupal\Tests\Component\Utility\test_access_arguments_resolver_access'];
     return $data;
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index 5bd6220..0b694c6 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -860,7 +860,7 @@ public function testAndOrCacheabilityPropagation(AccessResultInterface $first, $
    * tested in ::testOrIf().
    */
   public function testOrIfCacheabilityMerging() {
-    $merge_both_directions = function(AccessResult $a, AccessResult $b) {
+    $merge_both_directions = function (AccessResult $a, AccessResult $b) {
       // A globally cacheable access result.
       $a->setCacheMaxAge(3600);
       // Another access result that is cacheable per permissions.
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
index c7f1f3d..4ff4b83 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
@@ -76,7 +76,7 @@ protected function setUp() {
    * @see testRender
    */
   public function providerTestRender() {
-    $create_link_element = function($href, $media = 'all', $browsers = []) {
+    $create_link_element = function ($href, $media = 'all', $browsers = []) {
       return [
         '#type' => 'html_tag',
         '#tag' => 'link',
@@ -88,7 +88,7 @@ public function providerTestRender() {
         '#browsers' => $browsers,
       ];
     };
-    $create_style_element = function($value, $media, $browsers = []) {
+    $create_style_element = function ($value, $media, $browsers = []) {
       $style_element = [
         '#type' => 'html_tag',
         '#tag' => 'style',
@@ -101,7 +101,7 @@ public function providerTestRender() {
       return $style_element;
     };
 
-    $create_file_css_asset = function($data, $media = 'all', $preprocess = TRUE) {
+    $create_file_css_asset = function ($data, $media = 'all', $preprocess = TRUE) {
       return ['group' => 0, 'type' => 'file', 'media' => $media, 'preprocess' => $preprocess, 'data' => $data, 'browsers' => []];
     };
 
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
index 0b7aa25..5c41668 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -74,7 +74,7 @@ protected function setUp() {
    * @group legacy
    */
   public function testGetArguments() {
-    $controller = function(EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) {
+    $controller = function (EntityInterface $entity, $user, RouteMatchInterface $route_match, ServerRequestInterface $psr_7) {
     };
     $mock_entity = $this->getMockBuilder('Drupal\Core\Entity\Entity')
       ->disableOriginalConstructor()
diff --git a/core/tests/Drupal/Tests/Core/Database/ConditionTest.php b/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
index 13b6293..db2c89d 100644
--- a/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/ConditionTest.php
@@ -44,7 +44,7 @@ public function testSimpleCondition($expected, $field_name) {
     $query_placeholder = $this->prophesize(PlaceholderInterface::class);
 
     $counter = 0;
-    $query_placeholder->nextPlaceholder()->will(function() use (&$counter) {
+    $query_placeholder->nextPlaceholder()->will(function () use (&$counter) {
       return $counter++;
     });
     $query_placeholder->uniqueIdentifier()->willReturn(4);
@@ -85,7 +85,7 @@ public function testCompileWithKnownOperators($expected, $field, $value, $operat
     $query_placeholder = $this->prophesize(PlaceholderInterface::class);
 
     $counter = 0;
-    $query_placeholder->nextPlaceholder()->will(function() use (&$counter) {
+    $query_placeholder->nextPlaceholder()->will(function () use (&$counter) {
       return $counter++;
     });
     $query_placeholder->uniqueIdentifier()->willReturn(4);
@@ -153,7 +153,7 @@ public function testCompileWithSqlInjectionForOperator($operator) {
     $query_placeholder = $this->prophesize(PlaceholderInterface::class);
 
     $counter = 0;
-    $query_placeholder->nextPlaceholder()->will(function() use (&$counter) {
+    $query_placeholder->nextPlaceholder()->will(function () use (&$counter) {
       return $counter++;
     });
     $query_placeholder->uniqueIdentifier()->willReturn(4);
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index db92ca9..d16ece2 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -1344,14 +1344,14 @@ protected function setUpStorageSchema(array $expected = []) {
       $this->dbSchemaHandler->expects($this->any())
         ->method('createTable')
         ->with(
-          $this->callback(function($table_name) use (&$invocation_count, $expected_table_names) {
+          $this->callback(function ($table_name) use (&$invocation_count, $expected_table_names) {
             return $expected_table_names[$invocation_count] == $table_name;
           }),
-          $this->callback(function($table_schema) use (&$invocation_count, $expected_table_schemas) {
+          $this->callback(function ($table_schema) use (&$invocation_count, $expected_table_schemas) {
             return $expected_table_schemas[$invocation_count] == $table_schema;
           })
         )
-        ->will($this->returnCallback(function() use (&$invocation_count) {
+        ->will($this->returnCallback(function () use (&$invocation_count) {
           $invocation_count++;
         }));
     }
@@ -1496,7 +1496,7 @@ public function testonEntityTypeUpdateWithNewIndex() {
       ->willReturn(TRUE);
     $this->dbSchemaHandler->expects($this->atLeastOnce())
       ->method('addIndex')
-      ->with('entity_test', 'entity_test__b588603cb9', [['long_index_name', 10]], $this->callback(function($actual_value) use ($expected)  {
+      ->with('entity_test', 'entity_test__b588603cb9', [['long_index_name', 10]], $this->callback(function ($actual_value) use ($expected) {
         $this->assertEquals($expected['entity_test']['indexes'], $actual_value['indexes']);
         $this->assertEquals($expected['entity_test']['fields'], $actual_value['fields']);
         // If the parameters don't match, the assertions above will throw an
diff --git a/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php b/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
index 351788c..de7baa9 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php
@@ -1452,7 +1452,7 @@ public function testPrepareCallback($unprepared_callback, callable $prepared_cal
   public function providerPrepareCallback() {
     $function = 'sleep';
     $shorthand_form_method = '::submit()';
-    $closure = function() {};
+    $closure = function () {};
     $static_method_string = __METHOD__;
     $static_method_array = [__CLASS__, __FUNCTION__];
     $object_method_array = [$this, __FUNCTION__];
diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
index 67decbe..54fcfbd 100644
--- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php
@@ -50,7 +50,7 @@ protected function setUp() {
   public function testApplies(array $definition, $name, Route $route, $applies) {
     $this->entityManager->expects($this->any())
       ->method('hasDefinition')
-      ->willReturnCallback(function($entity_type) {
+      ->willReturnCallback(function ($entity_type) {
         return 'entity_test' == $entity_type;
       });
     $this->assertEquals($applies, $this->entityConverter->applies($definition, $name, $route));
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
index b9f8b07..573febc 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
@@ -86,7 +86,7 @@ public function testContextBubblingCustomCacheBin() {
     $this->cacheFactory->expects($this->atLeastOnce())
       ->method('get')
       ->with($bin)
-      ->willReturnCallback(function($requested_bin) use ($bin, $custom_cache) {
+      ->willReturnCallback(function ($requested_bin) use ($bin, $custom_cache) {
         if ($requested_bin === $bin) {
           return $custom_cache;
         }
@@ -315,7 +315,7 @@ public function testConditionalCacheContextBubblingSelfHealing() {
           'tags' => ['b'],
         ],
         'grandchild' => [
-          '#access_callback' => function() use (&$current_user_role) {
+          '#access_callback' => function () use (&$current_user_role) {
             // Only role A cannot access this subtree.
             return $current_user_role !== 'A';
           },
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index fb0c0c5..253a358 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -65,7 +65,7 @@ protected function setUp() {
   public function providerPlaceholders() {
     $args = [$this->randomContextValue()];
 
-    $generate_placeholder_markup = function($cache_keys = NULL) use ($args) {
+    $generate_placeholder_markup = function ($cache_keys = NULL) use ($args) {
       $token_render_array = [
         '#lazy_builder' => ['Drupal\Tests\Core\Render\PlaceholdersTest::callback', $args],
       ];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index f3ea379..010ffc2 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -179,7 +179,7 @@ public function providerTestRenderBasic() {
     $data[] = [
       [
         '#markup' => 'foo',
-        '#pre_render' => [function($elements) {
+        '#pre_render' => [function ($elements) {
           $elements['#markup'] .= '<script>alert("bar");</script>';
           return $elements;
         }
@@ -192,7 +192,7 @@ public function providerTestRenderBasic() {
       [
         '#markup' => 'foo',
         '#allowed_tags' => ['script'],
-        '#pre_render' => [function($elements) {
+        '#pre_render' => [function ($elements) {
           $elements['#markup'] .= '<script>alert("bar");</script>';
           return $elements;
         }
@@ -205,7 +205,7 @@ public function providerTestRenderBasic() {
     $data[] = [
       [
         '#plain_text' => 'foo',
-        '#pre_render' => [function($elements) {
+        '#pre_render' => [function ($elements) {
           $elements['#plain_text'] .= '<script>alert("bar");</script>';
           return $elements;
         }
@@ -225,12 +225,12 @@ public function providerTestRenderBasic() {
       '#theme_wrappers' => ['container'],
       '#attributes' => ['class' => ['baz']],
     ];
-    $setup_code_type_link = function() {
+    $setup_code_type_link = function () {
       $this->setupThemeContainer();
       $this->themeManager->expects($this->at(0))
         ->method('render')
         ->with('common_test_foo', $this->anything())
-        ->willReturnCallback(function($theme, $vars) {
+        ->willReturnCallback(function ($theme, $vars) {
           return $vars['#foo'] . $vars['#bar'];
         });
     };
@@ -250,12 +250,12 @@ public function providerTestRenderBasic() {
       '#url' => 'https://www.drupal.org',
       '#title' => 'bar',
     ];
-    $setup_code_type_link = function() {
+    $setup_code_type_link = function () {
       $this->setupThemeContainer();
       $this->themeManager->expects($this->at(0))
         ->method('render')
         ->with('link', $this->anything())
-        ->willReturnCallback(function($theme, $vars) {
+        ->willReturnCallback(function ($theme, $vars) {
           $attributes = new Attribute(['href' => $vars['#url']] + (isset($vars['#attributes']) ? $vars['#attributes'] : []));
           return '<a' . (string) $attributes . '>' . $vars['#title'] . '</a>';
         });
@@ -287,7 +287,7 @@ public function providerTestRenderBasic() {
         'container',
       ],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->setupThemeContainer($this->any());
     };
     $data[] = [$build, '<div class="foo"><div class="bar"></div>' . "\n" . '</div>' . "\n", $setup_code];
@@ -297,7 +297,7 @@ public function providerTestRenderBasic() {
       '#theme_wrappers' => [['container']],
       '#attributes' => ['class' => ['foo']],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->setupThemeContainerMultiSuggestion($this->any());
     };
     $data[] = [$build, '<div class="foo"></div>' . "\n", $setup_code];
@@ -311,7 +311,7 @@ public function providerTestRenderBasic() {
       '#theme' => ['suggestionnotimplemented'],
       '#markup' => 'foo',
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->themeManager->expects($this->once())
         ->method('render')
         ->with(['suggestionnotimplemented'], $this->anything())
@@ -326,7 +326,7 @@ public function providerTestRenderBasic() {
         '#markup' => 'foo',
       ],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->themeManager->expects($this->once())
         ->method('render')
         ->with(['suggestionnotimplemented'], $this->anything())
@@ -340,7 +340,7 @@ public function providerTestRenderBasic() {
       '#markup' => 'foo',
     ];
     $theme_function_output = $this->randomContextValue();
-    $setup_code = function() use ($theme_function_output) {
+    $setup_code = function () use ($theme_function_output) {
       $this->themeManager->expects($this->once())
         ->method('render')
         ->with(['common_test_empty'], $this->anything())
@@ -369,7 +369,7 @@ public function providerTestRenderBasic() {
       '#children' => 'baz',
       'child' => ['#markup' => 'boo'],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->themeManager->expects($this->once())
         ->method('render')
         ->with('common_test_foo', $this->anything())
@@ -388,7 +388,7 @@ public function providerTestRenderBasic() {
         '#markup' => 'boo',
       ],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->themeManager->expects($this->never())
         ->method('render');
     };
@@ -404,7 +404,7 @@ public function providerTestRenderBasic() {
         '#markup' => 'boo',
       ],
     ];
-    $setup_code = function() {
+    $setup_code = function () {
       $this->themeManager->expects($this->never())
         ->method('render');
     };
@@ -494,7 +494,7 @@ public function testRenderWithPresetAccess($access) {
    */
   public function testRenderWithAccessCallbackCallable($access) {
     $build = [
-      '#access_callback' => function() use ($access) {
+      '#access_callback' => function () use ($access) {
         return $access;
       }
     ];
@@ -513,7 +513,7 @@ public function testRenderWithAccessCallbackCallable($access) {
   public function testRenderWithAccessPropertyAndCallback($access) {
     $build = [
       '#access' => $access,
-      '#access_callback' => function() {
+      '#access_callback' => function () {
         return TRUE;
       }
     ];
@@ -625,7 +625,7 @@ protected function setupThemeContainer($matcher = NULL) {
     $this->themeManager->expects($matcher ?: $this->at(1))
       ->method('render')
       ->with('container', $this->anything())
-      ->willReturnCallback(function($theme, $vars) {
+      ->willReturnCallback(function ($theme, $vars) {
         return '<div' . (string) (new Attribute($vars['#attributes'])) . '>' . $vars['#children'] . "</div>\n";
       });
   }
@@ -634,7 +634,7 @@ protected function setupThemeContainerMultiSuggestion($matcher = NULL) {
     $this->themeManager->expects($matcher ?: $this->at(1))
       ->method('render')
       ->with(['container'], $this->anything())
-      ->willReturnCallback(function($theme, $vars) {
+      ->willReturnCallback(function ($theme, $vars) {
         return '<div' . (string) (new Attribute($vars['#attributes'])) . '>' . $vars['#children'] . "</div>\n";
       });
   }
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
index 964898c..258fa22 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
@@ -147,7 +147,7 @@ protected function setUp() {
     $current_user_role = &$this->currentUserRole;
     $this->cacheContextsManager->expects($this->any())
       ->method('convertTokensToKeys')
-      ->willReturnCallback(function($context_tokens) use (&$current_user_role) {
+      ->willReturnCallback(function ($context_tokens) use (&$current_user_role) {
         $keys = [];
         foreach ($context_tokens as $context_id) {
           switch ($context_id) {
diff --git a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
index 2d733c3..afe7f4d 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RedirectDestinationTest.php
@@ -49,7 +49,7 @@ protected function setUp() {
   protected function setupUrlGenerator() {
     $this->urlGenerator->expects($this->any())
       ->method('generateFromRoute')
-      ->willReturnCallback(function($route, $parameters, $options) {
+      ->willReturnCallback(function ($route, $parameters, $options) {
         $query_string = '';
         if (!empty($options['query'])) {
           $query_string = '?' . UrlHelper::buildQuery($options['query']);
diff --git a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
index ac19ffa..6ff00ec 100644
--- a/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
+++ b/core/tests/Drupal/Tests/Core/Transliteration/PhpTransliterationTest.php
@@ -40,7 +40,7 @@ public function testPhpTransliterationWithAlter($langcode, $original, $expected,
     $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
     $module_handler->expects($this->any())
       ->method('alter')
-      ->will($this->returnCallback(function($hook, &$overrides, $langcode) {
+      ->will($this->returnCallback(function ($hook, &$overrides, $langcode) {
         if ($langcode == 'zz') {
           // The default transliteration of Ä is A, but change it to Z for testing.
           $overrides[0xC4] = 'Z';
diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
index 08b8117..9ba110f 100644
--- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
@@ -83,7 +83,7 @@ protected function setUp() {
     $translator = $this->getMock('Drupal\Core\Validation\TranslatorInterface');
     $translator->expects($this->any())
       ->method('trans')
-      ->willReturnCallback(function($id) {
+      ->willReturnCallback(function ($id) {
         return $id;
       });
     $this->contextFactory = new ExecutionContextFactory($translator);
diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
index 50795b3..c53b474 100644
--- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
@@ -397,7 +397,7 @@ public function testGenerateWithHtml() {
   public function testGenerateActive() {
     $this->urlGenerator->expects($this->exactly(5))
       ->method('generateFromRoute')
-      ->willReturnCallback(function($name, $parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
+      ->willReturnCallback(function ($name, $parameters = [], $options = [], $collect_bubbleable_metadata = FALSE) {
         switch ($name) {
           case 'test_route_1':
             return (new GeneratedUrl())->setGeneratedUrl('/test-route-1');
diff --git a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
index 4df9172..a47d206 100644
--- a/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
@@ -147,7 +147,7 @@ public function testAssembleWithEnabledProcessing() {
     $this->setupRequestStack(FALSE);
     $this->pathProcessor->expects($this->exactly(2))
       ->method('processOutbound')
-      ->willReturnCallback(function($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
+      ->willReturnCallback(function ($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
         if ($bubbleable_metadata) {
           $bubbleable_metadata->setCacheContexts(['some-cache-context']);
         }
diff --git a/core/tests/Drupal/Tests/EntityViewTrait.php b/core/tests/Drupal/Tests/EntityViewTrait.php
index eb46e97..d8c9d92 100644
--- a/core/tests/Drupal/Tests/EntityViewTrait.php
+++ b/core/tests/Drupal/Tests/EntityViewTrait.php
@@ -35,7 +35,7 @@
    * @see drupal_render()
    */
   protected function buildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
-    $ensure_fully_built = function(&$elements) use (&$ensure_fully_built) {
+    $ensure_fully_built = function (&$elements) use (&$ensure_fully_built) {
       // If the default values for this element have not been loaded yet, populate
       // them.
       if (isset($elements['#type']) && empty($elements['#defaults_loaded'])) {
