Browse Source

minor #4797 clean ups (SpacePossum)

This PR was merged into the 2.15 branch.

Discussion
----------

clean ups

search `isGivenKind\(\[[^,]*\)` , more hits on `master` which I'll fix after merging this one

Commits
-------

68b3ead0 clean ups
SpacePossum 5 years ago
parent
commit
028132b725

+ 3 - 5
src/Fixer/ClassNotation/SelfAccessorFixer.php

@@ -178,13 +178,11 @@ class Sample
         foreach (array_reverse(Preg::split('/(\\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) {
             $index = $tokens->getPrevMeaningfulToken($index);
             if ('\\' === $piece) {
-                if (!$tokens[$index]->isGivenKind([T_NS_SEPARATOR])) {
-                    return null;
-                }
-            } else {
-                if (!$tokens[$index]->equals([T_STRING, $piece], false)) {
+                if (!$tokens[$index]->isGivenKind(T_NS_SEPARATOR)) {
                     return null;
                 }
+            } elseif (!$tokens[$index]->equals([T_STRING, $piece], false)) {
+                return null;
             }
         }
 

+ 1 - 1
src/Fixer/PhpUnit/PhpUnitSizeClassFixer.php

@@ -108,7 +108,7 @@ final class PhpUnitSizeClassFixer extends AbstractFixer implements WhitespacesAw
     {
         $typeIndex = $tokens->getPrevMeaningfulToken($i);
 
-        return $tokens[$typeIndex]->isGivenKind([T_ABSTRACT]);
+        return $tokens[$typeIndex]->isGivenKind(T_ABSTRACT);
     }
 
     private function createDocBlock(Tokens $tokens, $docBlockIndex)