Commit f39127ce authored by catch's avatar catch
Browse files

Issue #2901718 by mfernea: Fix 'Squiz.ControlStructures.ForEachLoopDeclaration' coding standard

parent da9c5ba2
...@@ -234,7 +234,7 @@ public function getLocalTasksForRoute($route_name) { ...@@ -234,7 +234,7 @@ public function getLocalTasksForRoute($route_name) {
if ($base_routes) { if ($base_routes) {
// Find all the plugins with the same root and that are at the top // Find all the plugins with the same root and that are at the top
// level or that have a visible parent. // 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']]))) { 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. // 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']; $parent = empty($task_info['parent_id']) ? '> ' . $task_info['base_route'] : $task_info['parent_id'];
......
...@@ -80,7 +80,7 @@ function color_library_info_alter(&$libraries, $extension) { ...@@ -80,7 +80,7 @@ function color_library_info_alter(&$libraries, $extension) {
if (isset($libraries[$name]['css'])) { if (isset($libraries[$name]['css'])) {
// Override stylesheets. // Override stylesheets.
foreach ($libraries[$name]['css'] as $category => $css_assets) { 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 // Loop over the path array with recolored CSS files to find matching
// paths which could replace the non-recolored paths. // paths which could replace the non-recolored paths.
foreach ($color_paths as $color_path) { foreach ($color_paths as $color_path) {
......
...@@ -97,7 +97,7 @@ public function query($group_by = FALSE) { ...@@ -97,7 +97,7 @@ public function query($group_by = FALSE) {
$search_dataset = $this->query->addTable('node_search_dataset'); $search_dataset = $this->query->addTable('node_search_dataset');
$conditions = $this->searchQuery->conditions(); $conditions = $this->searchQuery->conditions();
$condition_conditions =& $conditions->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. // Make sure we just look at real conditions.
if (is_numeric($key)) { if (is_numeric($key)) {
// Replace the conditions with the table alias of views. // Replace the conditions with the table alias of views.
......
...@@ -172,7 +172,7 @@ public function query() { ...@@ -172,7 +172,7 @@ public function query() {
$search_dataset = $this->query->addTable('node_search_dataset'); $search_dataset = $this->query->addTable('node_search_dataset');
$conditions = $this->searchQuery->conditions(); $conditions = $this->searchQuery->conditions();
$condition_conditions =& $conditions->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. // Make sure we just look at real conditions.
if (is_numeric($key)) { if (is_numeric($key)) {
// Replace the conditions with the table alias of views. // Replace the conditions with the table alias of views.
......
...@@ -147,6 +147,17 @@ ...@@ -147,6 +147,17 @@
</rule> </rule>
<!-- Squiz sniffs --> <!-- 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"/> <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
<!-- Disable some error messages that we already cover. --> <!-- Disable some error messages that we already cover. -->
<rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen"> <rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment