Browse Source

DX: php_unit_test_case_static_method_calls - use default config

Dariusz Ruminski 5 years ago
parent
commit
f8e5135a1e

+ 1 - 1
src/Console/Output/ErrorOutput.php

@@ -65,7 +65,7 @@ final class ErrorOutput
             $message = $e->getMessage();
             $code = $e->getCode();
             if (0 !== $code) {
-                $message .= " (${code})";
+                $message .= " ({$code})";
             }
 
             $length = max(\strlen($class), \strlen($message));

+ 1 - 1
src/DocBlock/Tag.php

@@ -94,7 +94,7 @@ class Tag
             throw new \RuntimeException('Cannot set name on unknown tag.');
         }
 
-        $this->line->setContent(Preg::replace("/@${current}/", "@${name}", $this->line->getContent(), 1));
+        $this->line->setContent(Preg::replace("/@{$current}/", "@{$name}", $this->line->getContent(), 1));
 
         $this->name = $name;
     }

+ 1 - 1
src/Fixer/ControlStructure/NoBreakCommentFixer.php

@@ -184,7 +184,7 @@ switch ($foo) {
 
         $text = preg_quote($this->configuration['comment_text'], '~');
 
-        return 1 === Preg::match("~^((//|#)\\s*${text}\\s*)|(/\\*\\*?\\s*${text}\\s*\\*/)$~i", $token->getContent());
+        return 1 === Preg::match("~^((//|#)\\s*{$text}\\s*)|(/\\*\\*?\\s*{$text}\\s*\\*/)$~i", $token->getContent());
     }
 
     /**

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

@@ -132,7 +132,7 @@ final class PhpUnitInternalClassFixer extends AbstractFixer implements Whitespac
         $lineEnd = $this->whitespacesConfig->getLineEnding();
         $originalIndent = $this->detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
         $toInsert = [
-            new Token([T_DOC_COMMENT, '/**'.$lineEnd."${originalIndent} * @internal".$lineEnd."${originalIndent} */"]),
+            new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @internal".$lineEnd."{$originalIndent} */"]),
             new Token([T_WHITESPACE, $lineEnd.$originalIndent]),
         ];
         $index = $tokens->getNextMeaningfulToken($docBlockIndex);

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

@@ -280,7 +280,7 @@ final class MyTest extends \PHPUnit_Framework_TestCase
         if ($this->configuration['use_class_const']) {
             $params[] = $exceptionClass.'::class';
         } else {
-            $params[] = "'${exceptionClass}'";
+            $params[] = "'{$exceptionClass}'";
         }
 
         if (isset($annotations['expectedExceptionMessage'])) {

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

@@ -345,7 +345,7 @@ public function testItDoesSomething() {}}'.$this->whitespacesConfig->getLineEndi
         $lineEnd = $this->whitespacesConfig->getLineEnding();
         $originalIndent = $this->detectIndent($tokens, $tokens->getNextNonWhitespace($docBlockIndex));
         $toInsert = [
-            new Token([T_DOC_COMMENT, '/**'.$lineEnd."${originalIndent} * @test".$lineEnd."${originalIndent} */"]),
+            new Token([T_DOC_COMMENT, '/**'.$lineEnd."{$originalIndent} * @test".$lineEnd."{$originalIndent} */"]),
             new Token([T_WHITESPACE, $lineEnd.$originalIndent]),
         ];
         $index = $tokens->getNextMeaningfulToken($docBlockIndex);

+ 1 - 1
src/RuleSet.php

@@ -255,7 +255,7 @@ final class RuleSet implements RuleSetInterface
             'php_unit_set_up_tear_down_visibility' => true,
             'php_unit_strict' => true,
             'php_unit_test_annotation' => true,
-            'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
+            'php_unit_test_case_static_method_calls' => true,
             'strict_comparison' => true,
             'strict_param' => true,
             'string_line_ending' => true,

+ 2 - 2
tests/AbstractFunctionReferenceFixerTest.php

@@ -56,7 +56,7 @@ final class AbstractFunctionReferenceFixerTest extends TestCase
     ) {
         $tokens = Tokens::fromCode($source);
 
-        $this->assertSame(
+        static::assertSame(
             $expected,
             $this->fixer->findTest(
                 $functionNameToSearch,
@@ -66,7 +66,7 @@ final class AbstractFunctionReferenceFixerTest extends TestCase
             )
         );
 
-        $this->assertFalse($tokens->isChanged());
+        static::assertFalse($tokens->isChanged());
     }
 
     public function provideAbstractFunctionReferenceFixerCases()

+ 1 - 1
tests/AutoReview/CommandTest.php

@@ -34,7 +34,7 @@ final class CommandTest extends TestCase
      */
     public function testCommandHasNameConst(Command $command)
     {
-        $this->assertSame($command->getName(), \constant(\get_class($command).'::COMMAND_NAME'));
+        static::assertSame($command->getName(), \constant(\get_class($command).'::COMMAND_NAME'));
     }
 
     public function provideCommandHasNameConstCases()

+ 1 - 1
tests/AutoReview/ComposerTest.php

@@ -35,7 +35,7 @@ final class ComposerTest extends TestCase
             return;
         }
 
-        $this->assertSame(
+        static::assertSame(
             ['dev-master' => $this->convertAppVersionToAliasedVersion(Application::VERSION)],
             $composerJson['extra']['branch-alias']
         );

Some files were not shown because too many files changed in this diff