WIP/POC - PHP 7.4 - Support

by @SpacePossum

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/4412/36152c193e2d3594b3e60b7decde75c54b7336bc/cs.diff | patch -p0
diff -ru tests/Tokenizer/TokensAnalyzerTest.php tests/Tokenizer/TokensAnalyzerTest.php
--- tests/Tokenizer/TokensAnalyzerTest.php	2019-05-14 06:55:17.629489723 +0000
+++ tests/Tokenizer/TokensAnalyzerTest.php	2019-05-14 06:55:18.748460046 +0000
@@ -69,7 +69,7 @@
         $tokensAnalyzer = new TokensAnalyzer($tokens);
         $elements = $tokensAnalyzer->getClassyElements();
 
-        static::assertSame(
+        $this->assertSame(
             [
                 9 => [
                     'token' => $tokens[9],
@@ -148,7 +148,7 @@
         $tokensAnalyzer = new TokensAnalyzer($tokens);
         $elements = $tokensAnalyzer->getClassyElements();
 
-        static::assertSame(
+        $this->assertSame(
             [
                 9 => [
                     'token' => $tokens[9],
@@ -261,7 +261,7 @@
         $tokensAnalyzer = new TokensAnalyzer($tokens);
         $elements = $tokensAnalyzer->getClassyElements();
 
-        static::assertSame(
+        $this->assertSame(
             [
                 9 => [
                     'token' => $tokens[9],
@@ -379,7 +379,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $expectedValue) {
-            static::assertSame($expectedValue, $tokensAnalyzer->isAnonymousClass($index));
+            $this->assertSame($expectedValue, $tokensAnalyzer->isAnonymousClass($index));
         }
     }
 
@@ -419,7 +419,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isLambda) {
-            static::assertSame($isLambda, $tokensAnalyzer->isLambda($index));
+            $this->assertSame($isLambda, $tokensAnalyzer->isLambda($index));
         }
     }
 
@@ -471,7 +471,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $expectedValue) {
-            static::assertSame($expectedValue, $tokensAnalyzer->isLambda($index));
+            $this->assertSame($expectedValue, $tokensAnalyzer->isLambda($index));
         }
     }
 
@@ -506,7 +506,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $expectedValue) {
-            static::assertSame($expectedValue, $tokensAnalyzer->isLambda($index));
+            $this->assertSame($expectedValue, $tokensAnalyzer->isLambda($index));
         }
     }
 
@@ -554,7 +554,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isLambda) {
-            static::assertSame($isLambda, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
+            $this->assertSame($isLambda, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
         }
     }
 
@@ -719,7 +719,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $expectedValue) {
-            static::assertSame($expectedValue, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
+            $this->assertSame($expectedValue, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
         }
     }
 
@@ -748,7 +748,7 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $expectedValue) {
-            static::assertSame($expectedValue, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
+            $this->assertSame($expectedValue, $tokensAnalyzer->isConstantInvocation($index), 'Token at index '.$index.' should match the expected value.');
         }
     }
 
@@ -780,10 +780,10 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isUnary) {
-            static::assertSame($isUnary, $tokensAnalyzer->isUnarySuccessorOperator($index));
+            $this->assertSame($isUnary, $tokensAnalyzer->isUnarySuccessorOperator($index));
             if ($isUnary) {
-                static::assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
-                static::assertFalse($tokensAnalyzer->isBinaryOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isBinaryOperator($index));
             }
         }
     }
@@ -836,10 +836,10 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isUnary) {
-            static::assertSame($isUnary, $tokensAnalyzer->isUnaryPredecessorOperator($index));
+            $this->assertSame($isUnary, $tokensAnalyzer->isUnaryPredecessorOperator($index));
             if ($isUnary) {
-                static::assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
-                static::assertFalse($tokensAnalyzer->isBinaryOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isBinaryOperator($index));
             }
         }
     }
@@ -920,10 +920,10 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isBinary) {
-            static::assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
+            $this->assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
             if ($isBinary) {
-                static::assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
-                static::assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
             }
         }
     }
@@ -1069,10 +1069,10 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isBinary) {
-            static::assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
+            $this->assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
             if ($isBinary) {
-                static::assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
-                static::assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
             }
         }
     }
@@ -1102,8 +1102,8 @@
     {
         $tokens = Tokens::fromCode($source);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
-        static::assertTrue($tokensAnalyzer->isArray($tokenIndex), 'Expected to be an array.');
-        static::assertSame($isMultiLineArray, $tokensAnalyzer->isArrayMultiLine($tokenIndex), sprintf('Expected %sto be a multiline array', $isMultiLineArray ? '' : 'not '));
+        $this->assertTrue($tokensAnalyzer->isArray($tokenIndex), 'Expected to be an array.');
+        $this->assertSame($isMultiLineArray, $tokensAnalyzer->isArrayMultiLine($tokenIndex), sprintf('Expected %sto be a multiline array', $isMultiLineArray ? '' : 'not '));
     }
 
     public function provideIsArrayCases()
@@ -1182,7 +1182,7 @@
 
         foreach ($tokens as $index => $token) {
             $expect = \in_array($index, $tokenIndexes, true);
-            static::assertSame(
+            $this->assertSame(
                 $expect,
                 $tokensAnalyzer->isArray($index),
                 sprintf('Expected %sarray, got @ %d "%s".', $expect ? '' : 'no ', $index, var_export($token, true))
@@ -1217,10 +1217,10 @@
         $tokensAnalyzer = new TokensAnalyzer(Tokens::fromCode($source));
 
         foreach ($expected as $index => $isBinary) {
-            static::assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
+            $this->assertSame($isBinary, $tokensAnalyzer->isBinaryOperator($index));
             if ($isBinary) {
-                static::assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
-                static::assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnarySuccessorOperator($index));
+                $this->assertFalse($tokensAnalyzer->isUnaryPredecessorOperator($index));
             }
         }
     }
@@ -1245,7 +1245,7 @@
     {
         $tokens = Tokens::fromCode($source);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
-        static::assertFalse($tokensAnalyzer->isArray($tokenIndex));
+        $this->assertFalse($tokensAnalyzer->isArray($tokenIndex));
     }
 
     /**
@@ -1285,7 +1285,7 @@
         $tokens = Tokens::fromCode($source);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
         $attributes = $tokensAnalyzer->getMethodAttributes($index);
-        static::assertSame($expected, $attributes);
+        $this->assertSame($expected, $attributes);
     }
 
     public function provideGetFunctionPropertiesCases()
@@ -1413,7 +1413,7 @@
                 continue;
             }
 
-            static::assertSame(
+            $this->assertSame(
                 $expected[$index],
                 $tokensAnalyzer->isWhilePartOfDoWhile($index),
                 sprintf('Expected token at index "%d" to be detected as %sa "do-while"-loop.', $index, true === $expected[$index] ? '' : 'not ')
@@ -1431,7 +1431,7 @@
     {
         $tokens = Tokens::fromCode($input);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
-        static::assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
+        $this->assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
     }
 
     public function provideGetImportUseIndexesCases()
@@ -1507,7 +1507,7 @@
     {
         $tokens = Tokens::fromCode($input);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
-        static::assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
+        $this->assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
     }
 
     public function provideGetImportUseIndexesPHP70Cases()
@@ -1544,7 +1544,7 @@
     {
         $tokens = Tokens::fromCode($input);
         $tokensAnalyzer = new TokensAnalyzer($tokens);
-        static::assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
+        $this->assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace));
     }
 
     public function provideGetImportUseIndexesPHP72Cases()

0
Common Typos

0
File Permissions