From 3a6cac15da1489473b890bbcf2164c36d52e2023 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 28 Apr 2016 14:31:22 +0100
Subject: [PATCH] Issue #2572731 by attiks, andypost: Fix
 'Drupal.Formatting.SpaceUnaryOperator' coding standard

---
 core/lib/Drupal/Component/Diff/DiffFormatter.php     | 2 +-
 core/lib/Drupal/Component/Diff/Engine/DiffEngine.php | 2 +-
 core/lib/Drupal/Core/Entity/Query/Sql/Tables.php     | 2 +-
 core/phpcs.xml.dist                                  | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/core/lib/Drupal/Component/Diff/DiffFormatter.php b/core/lib/Drupal/Component/Diff/DiffFormatter.php
index 5dc9e1b15bf7..55837062725c 100644
--- a/core/lib/Drupal/Component/Diff/DiffFormatter.php
+++ b/core/lib/Drupal/Component/Diff/DiffFormatter.php
@@ -73,7 +73,7 @@ public function format(Diff $diff) {
         $context = $edit->orig;
       }
       else {
-        if (! is_array($block)) {
+        if (!is_array($block)) {
           $context = array_slice($context, sizeof($context) - $nlead);
           $x0 = $xi - sizeof($context);
           $y0 = $yi - sizeof($context);
diff --git a/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php b/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php
index 78ec76a5f04d..020ce139c30d 100644
--- a/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php
+++ b/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php
@@ -363,7 +363,7 @@ protected function _shift_boundaries($lines, &$changed, $other_changed) {
       while ($j < $other_len && $other_changed[$j]) {
         $j++;
       }
-      while ($i < $len && ! $changed[$i]) {
+      while ($i < $len && !$changed[$i]) {
         $this::USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]');
         $i++;
         $j++;
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
index 91c5efa36efd..2175b114d66e 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -80,7 +80,7 @@ public function addField($field, $type, $langcode) {
     $entity_type = $this->entityManager->getDefinition($entity_type_id);
 
     $field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
-    for ($key = 0; $key <= $count; $key ++) {
+    for ($key = 0; $key <= $count; $key++) {
       // This can either be the name of an entity base field or a configurable
       // field.
       $specifier = $specifiers[$key];
diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index e031e935f3b9..6f860c29e0e1 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -22,6 +22,7 @@
   <rule ref="Drupal.Files.EndFileNewline"/>
   <rule ref="Drupal.Files.TxtFileLineLength"/>
   <rule ref="Drupal.Formatting.SpaceInlineIf"/>
+  <rule ref="Drupal.Formatting.SpaceUnaryOperator"/>
   <rule ref="Drupal.Functions.DiscouragedFunctions"/>
   <rule ref="Drupal.Functions.FunctionDeclaration.SpaceAfter"/>
   <rule ref="Drupal.Functions.FunctionDeclaration.SpaceBeforeParenthesis"/>
-- 
GitLab