Fix MultilineWhitespaceBeforeSemicolonsFixer

by @ossinkine

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/FriendsOfPHP/PHP-CS-Fixer/5126/7044b710c292b74e47e7b4e390a8e9ed8401b513/cs.diff | patch -p0
diff -ru src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php
--- src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php	2021-05-03 22:11:27.119693667 +0000
+++ src/Fixer/FunctionNotation/MethodArgumentSpaceFixer.php	2021-05-03 22:11:36.025475040 +0000
@@ -442,8 +442,8 @@
             $prevIndex = $tokens->getPrevNonWhitespace($index - 1);
 
             if (
-                !$tokens[$prevIndex]->equals(',') && !$tokens[$prevIndex]->isComment() &&
-                ($this->configuration['after_heredoc'] || !$tokens[$prevIndex]->isGivenKind(T_END_HEREDOC))
+                !$tokens[$prevIndex]->equals(',') && !$tokens[$prevIndex]->isComment()
+                && ($this->configuration['after_heredoc'] || !$tokens[$prevIndex]->isGivenKind(T_END_HEREDOC))
             ) {
                 $tokens->clearAt($index - 1);
             }
diff -ru src/Fixer/Operator/BinaryOperatorSpacesFixer.php src/Fixer/Operator/BinaryOperatorSpacesFixer.php
--- src/Fixer/Operator/BinaryOperatorSpacesFixer.php	2021-05-03 22:11:27.877675059 +0000
+++ src/Fixer/Operator/BinaryOperatorSpacesFixer.php	2021-05-03 22:11:37.727433259 +0000
@@ -160,8 +160,8 @@
     public function configure(array $configuration = null)
     {
         if (
-            null !== $configuration &&
-            (\array_key_exists('align_equals', $configuration) || \array_key_exists('align_double_arrow', $configuration))
+            null !== $configuration
+            && (\array_key_exists('align_equals', $configuration) || \array_key_exists('align_double_arrow', $configuration))
         ) {
             $configuration = $this->resolveOldConfig($configuration);
         }
diff -ru src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php
--- src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php	2021-05-03 22:11:28.283665093 +0000
+++ src/Fixer/PhpUnit/PhpUnitTestAnnotationFixer.php	2021-05-03 22:11:38.848405740 +0000
@@ -332,10 +332,10 @@
                 // One we split it up, we run the function again, so we deal with other things in a proper way
             }
 
-            if (!$needsAnnotation &&
-                false !== strpos($lines[$i]->getContent(), ' @test') &&
-                false === strpos($lines[$i]->getContent(), '@testWith') &&
-                false === strpos($lines[$i]->getContent(), '@testdox')
+            if (!$needsAnnotation
+                && false !== strpos($lines[$i]->getContent(), ' @test')
+                && false === strpos($lines[$i]->getContent(), '@testWith')
+                && false === strpos($lines[$i]->getContent(), '@testdox')
             ) {
                 // We remove @test from the doc block
                 $lines[$i] = new Line(str_replace(' @test', '', $lines[$i]->getContent()));
diff -ru src/Tokenizer/TokensAnalyzer.php src/Tokenizer/TokensAnalyzer.php
--- src/Tokenizer/TokensAnalyzer.php	2021-05-03 22:11:29.978623483 +0000
+++ src/Tokenizer/TokensAnalyzer.php	2021-05-03 22:11:45.529241733 +0000
@@ -152,9 +152,9 @@
             }
 
             if (
-                $token->isWhitespace() &&
-                !$tokens[$index - 1]->isGivenKind(T_END_HEREDOC) &&
-                false !== strpos($token->getContent(), "\n")
+                $token->isWhitespace()
+                && !$tokens[$index - 1]->isGivenKind(T_END_HEREDOC)
+                && false !== strpos($token->getContent(), "\n")
             ) {
                 return true;
             }
@@ -308,8 +308,8 @@
         $nextIndex = $this->tokens->getNextMeaningfulToken($index);
 
         if (
-            $this->tokens[$nextIndex]->equalsAny(['(', '{']) ||
-            $this->tokens[$nextIndex]->isGivenKind([T_AS, T_DOUBLE_COLON, T_ELLIPSIS, T_NS_SEPARATOR, CT::T_RETURN_REF, CT::T_TYPE_ALTERNATION, T_VARIABLE])
+            $this->tokens[$nextIndex]->equalsAny(['(', '{'])
+            || $this->tokens[$nextIndex]->isGivenKind([T_AS, T_DOUBLE_COLON, T_ELLIPSIS, T_NS_SEPARATOR, CT::T_RETURN_REF, CT::T_TYPE_ALTERNATION, T_VARIABLE])
         ) {
             return false;
         }

0
Common Typos

0
File Permissions

Issues that cannot be fixed automatically

in Commits list, a `git rebase` is needed to remove any merges
  • Merge branch '2.16' into issue-4896

0
Exception Messages Formatting

0
Usage of void in test files

0
Use ::class whenever possible