diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php index c14d1de1a32262c79417a58e37b66c42bb3d93bf..1046a9f13b9dc97cc62279800293993b4f2a5159 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -234,7 +234,7 @@ public function getLocalTasksForRoute($route_name) { if ($base_routes) { // Find all the plugins with the same root and that are at the top // level or that have a visible parent. - foreach ($definitions as $plugin_id => $task_info) { + foreach ($definitions as $plugin_id => $task_info) { if (!empty($base_routes[$task_info['base_route']]) && (empty($task_info['parent_id']) || !empty($parents[$task_info['parent_id']]))) { // Concat '> ' with root ID for the parent of top-level tabs. $parent = empty($task_info['parent_id']) ? '> ' . $task_info['base_route'] : $task_info['parent_id']; diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 84abac1f50f21b188e4016055409765d977efb99..2de53f5c17c0cd3b4f5ffb00efd8522389b45e8e 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -80,7 +80,7 @@ function color_library_info_alter(&$libraries, $extension) { if (isset($libraries[$name]['css'])) { // Override stylesheets. foreach ($libraries[$name]['css'] as $category => $css_assets) { - foreach ($css_assets as $path => $metadata) { + foreach ($css_assets as $path => $metadata) { // Loop over the path array with recolored CSS files to find matching // paths which could replace the non-recolored paths. foreach ($color_paths as $color_path) { diff --git a/core/modules/search/src/Plugin/views/argument/Search.php b/core/modules/search/src/Plugin/views/argument/Search.php index 7e9f00d4bd8225ebbc10c1a241e6082c352da80e..f9cd9a14b3f35ff316f6bf4a5155ac7fe4f55bbe 100644 --- a/core/modules/search/src/Plugin/views/argument/Search.php +++ b/core/modules/search/src/Plugin/views/argument/Search.php @@ -97,7 +97,7 @@ public function query($group_by = FALSE) { $search_dataset = $this->query->addTable('node_search_dataset'); $conditions = $this->searchQuery->conditions(); $condition_conditions =& $conditions->conditions(); - foreach ($condition_conditions as $key => &$condition) { + foreach ($condition_conditions as $key => &$condition) { // Make sure we just look at real conditions. if (is_numeric($key)) { // Replace the conditions with the table alias of views. diff --git a/core/modules/search/src/Plugin/views/filter/Search.php b/core/modules/search/src/Plugin/views/filter/Search.php index ac0f671ae21cbb9c30056ba14775fe752340b09a..b1884d5ac327c1ef305f05d9557a94a4ea4fde99 100644 --- a/core/modules/search/src/Plugin/views/filter/Search.php +++ b/core/modules/search/src/Plugin/views/filter/Search.php @@ -172,7 +172,7 @@ public function query() { $search_dataset = $this->query->addTable('node_search_dataset'); $conditions = $this->searchQuery->conditions(); $condition_conditions =& $conditions->conditions(); - foreach ($condition_conditions as $key => &$condition) { + foreach ($condition_conditions as $key => &$condition) { // Make sure we just look at real conditions. if (is_numeric($key)) { // Replace the conditions with the table alias of views. diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 59b33c4ab314a6c4f294fd23dd3a642f8a22e15f..612012b9b7cc84a6554a0195bd2508ea92cce3e1 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -147,6 +147,17 @@ </rule> <!-- Squiz sniffs --> + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" /> + <!-- Disable some error messages that we already cover. --> + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower"> + <severity>0</severity> + </rule> + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen"> + <severity>0</severity> + </rule> + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose"> + <severity>0</severity> + </rule> <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/> <!-- Disable some error messages that we already cover. --> <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen">