Просмотр исходного кода

Make static data providers that are not using dynamic calls (#6696)

Kuba Werłos 2 лет назад
Родитель
Сommit
a2bdba33dd

+ 1 - 1
tests/AbstractDoctrineAnnotationFixerTestCase.php

@@ -34,7 +34,7 @@ abstract class AbstractDoctrineAnnotationFixerTestCase extends AbstractFixerTest
         $this->fixer->configure($configuration);
     }
 
-    public function provideInvalidConfigurationCases(): array
+    public static function provideInvalidConfigurationCases(): array
     {
         return [
             [['foo' => 'bar']],

+ 1 - 1
tests/AbstractFunctionReferenceFixerTest.php

@@ -55,7 +55,7 @@ final class AbstractFunctionReferenceFixerTest extends TestCase
         static::assertFalse($tokens->isChanged());
     }
 
-    public function provideAbstractFunctionReferenceFixerCases(): array
+    public static function provideAbstractFunctionReferenceFixerCases(): array
     {
         return [
             'simple case I' => [

+ 1 - 1
tests/AutoReview/CommandTest.php

@@ -38,7 +38,7 @@ final class CommandTest extends TestCase
         static::assertNotNull($command::getDefaultName());
     }
 
-    public function provideCommandHasNameConstCases(): array
+    public static function provideCommandHasNameConstCases(): array
     {
         $application = new Application();
         $commands = $application->all();

+ 1 - 1
tests/AutoReview/DescribeCommandTest.php

@@ -49,7 +49,7 @@ final class DescribeCommandTest extends TestCase
         static::assertSame(0, $commandTester->getStatusCode());
     }
 
-    public function provideDescribeCommandCases(): iterable
+    public static function provideDescribeCommandCases(): iterable
     {
         $factory = new FixerFactory();
         $factory->registerBuiltInFixers();

+ 2 - 2
tests/AutoReview/FixerFactoryTest.php

@@ -137,7 +137,7 @@ final class FixerFactoryTest extends TestCase
         static::assertCount(0, $missingIntegrationsTests, sprintf("There shall be an integration test. How do you know that priority set up is good, if there is no integration test to check it?\nMissing:\n- %s", implode("\n- ", $missingIntegrationsTests)));
     }
 
-    public function provideFixersPriorityCasesHaveIntegrationCases(): iterable
+    public static function provideFixersPriorityCasesHaveIntegrationCases(): iterable
     {
         foreach (self::getFixersPriorityGraph() as $fixerName => $edges) {
             yield $fixerName => [$fixerName, $edges];
@@ -168,7 +168,7 @@ final class FixerFactoryTest extends TestCase
         );
     }
 
-    public function provideIntegrationTestFilesCases(): iterable
+    public static function provideIntegrationTestFilesCases(): iterable
     {
         foreach (new \DirectoryIterator(self::getIntegrationPriorityDirectory()) as $candidate) {
             if (!$candidate->isDot()) {

+ 2 - 2
tests/AutoReview/ProjectCodeTest.php

@@ -683,7 +683,7 @@ final class ProjectCodeTest extends TestCase
     /**
      * @return iterable<array{class-string<TestCase>}>
      */
-    public function provideTestClassCases(): iterable
+    public static function provideTestClassCases(): iterable
     {
         if (null === self::$testClassCases) {
             self::$testClassCases = array_map(
@@ -716,7 +716,7 @@ final class ProjectCodeTest extends TestCase
         static::assertTrue($reflection->isSubclassOf(AbstractPhpUnitFixer::class));
     }
 
-    public function providePhpUnitFixerExtendsAbstractPhpUnitFixerCases(): iterable
+    public static function providePhpUnitFixerExtendsAbstractPhpUnitFixerCases(): iterable
     {
         $factory = new FixerFactory();
         $factory->registerBuiltInFixers();

+ 1 - 1
tests/AutoReview/TransformerTest.php

@@ -101,7 +101,7 @@ final class TransformerTest extends TestCase
     /**
      * @return TransformerInterface[]
      */
-    public function provideTransformerCases(): array
+    public static function provideTransformerCases(): array
     {
         static $transformersArray = null;
 

+ 2 - 2
tests/Cache/CacheTest.php

@@ -119,7 +119,7 @@ final class CacheTest extends TestCase
         Cache::fromJson($json);
     }
 
-    public function provideMissingDataCases(): array
+    public static function provideMissingDataCases(): array
     {
         $data = [
             'php' => '7.1.2',
@@ -158,7 +158,7 @@ final class CacheTest extends TestCase
         static::assertSame($hash, $cached->get($file));
     }
 
-    public function provideCanConvertToAndFromJsonCases(): array
+    public static function provideCanConvertToAndFromJsonCases(): array
     {
         $toolInfo = new ToolInfo();
         $config = new Config();

+ 1 - 1
tests/Cache/SignatureTest.php

@@ -65,7 +65,7 @@ final class SignatureTest extends TestCase
         static::assertFalse($signature->equals($anotherSignature));
     }
 
-    public function provideEqualsReturnsFalseIfValuesAreNotIdenticalCases(): iterable
+    public static function provideEqualsReturnsFalseIfValuesAreNotIdenticalCases(): iterable
     {
         $php = PHP_VERSION;
         $version = '2.0';

+ 1 - 1
tests/ConfigTest.php

@@ -248,7 +248,7 @@ final class ConfigTest extends TestCase
         static::assertFalse($config->getUsingCache());
     }
 
-    public function provideRegisterCustomFixersCases(): array
+    public static function provideRegisterCustomFixersCases(): array
     {
         $fixers = [
             new NoWhitespaceBeforeCommaInArrayFixer(),

Некоторые файлы не были показаны из-за большого количества измененных файлов