Skip to content

Commit 0cecc8f

Browse files
Merge pull request #145 from oliverklee/task/static-data-providers
[TASK] Make the data providers static
2 parents 899c424 + 4b25313 commit 0cecc8f

14 files changed

+28
-28
lines changed

tests/Unit/Rule/ValidatorResolverOptionsRule/ValidatorResolverOptionsRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class ValidatorResolverOptionsRuleTest extends RuleTestCase
1313
{
1414

1515
/**
16-
* @dataProvider provideDataWithErrors()
16+
* @dataProvider provideDataWithErrors
1717
*
1818
* @param list<array{0: string, 1: int, 2?: string}> $expectedErrorMessagesWithLines
1919
*/
@@ -27,7 +27,7 @@ public function testRuleWithoutErrors(): void
2727
$this->analyse([__DIR__ . '/Fixture/CreateValidatorWithCorrectOptions.php'], []);
2828
}
2929

30-
public function provideDataWithErrors(): \Iterator
30+
public static function provideDataWithErrors(): \Iterator
3131
{
3232
yield [
3333
__DIR__ . '/Fixture/CreateValidatorWithUnresolvableType.php',

tests/Unit/Type/ContextDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class ContextDynamicReturnTypeExtensionTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
1515
// path to a file with actual asserts of expected types:
16-
yield from $this->gatherAssertTypes(__DIR__ . '/data/context-get-aspect-return-types.php');
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/context-get-aspect-return-types.php');
1717
}
1818

1919
/**

tests/Unit/Type/DateTimeAspectGetDynamicReturnTypeExtension/DateTimeAspectGetDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ final class DateTimeAspectGetDynamicReturnTypeExtensionTest extends TypeInferenc
1111
*
1212
* @return iterable<mixed>
1313
*/
14-
public function dataFileAsserts(): iterable
14+
public static function dataFileAsserts(): iterable
1515
{
16-
yield from $this->gatherAssertTypes(__DIR__ . '/data/datetime-aspect-get-return-types.php');
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/datetime-aspect-get-return-types.php');
1717
}
1818

1919
/**

tests/Unit/Type/GeneralUtilityGetIndpEnvDynamicReturnTypeExtension/GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ final class GeneralUtilityGetIndpEnvDynamicReturnTypeExtensionTest extends TypeI
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/GeneralUtilityGetIndpEnvTest.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/GeneralUtilityGetIndpEnvTest.php');
1616
}
1717

1818
/**

tests/Unit/Type/MathUtilityTypeSpecifyingExtension/MathUtilityTypeSpecifyingExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ final class MathUtilityTypeSpecifyingExtensionTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/MathUtilityTest.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/MathUtilityTest.php');
1616
}
1717

1818
/**

tests/Unit/Type/ObjectStorageStubFileTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class ObjectStorageStubFileTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/object-storage-stub-files.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/object-storage-stub-files.php');
1616
}
1717

1818
/**

tests/Unit/Type/PropertyMapperReturnTypeExtension/PropertyMapperReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ final class PropertyMapperReturnTypeExtensionTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/property-converter-types.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/property-converter-types.php');
1616
}
1717

1818
/**

tests/Unit/Type/QueryFactoryStubFileTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class QueryFactoryStubFileTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/query-factory-stub-files.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/query-factory-stub-files.php');
1616
}
1717

1818
/**

tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/QueryResultToArrayDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ final class QueryResultToArrayDynamicReturnTypeExtensionTest extends TypeInferen
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/query-result-to-array.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/query-result-to-array.php');
1616
}
1717

1818
/**

tests/Unit/Type/RepositoryQueryDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class RepositoryQueryDynamicReturnTypeExtensionTest extends TypeInferenceTestCas
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/custom-query-type.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/custom-query-type.php');
1616
}
1717

1818
/**

tests/Unit/Type/RepositoryStubFileTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class RepositoryStubFileTest extends TypeInferenceTestCase
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
15-
yield from $this->gatherAssertTypes(__DIR__ . '/data/repository-stub-files.php');
15+
yield from self::gatherAssertTypes(__DIR__ . '/data/repository-stub-files.php');
1616
}
1717

1818
/**

tests/Unit/Type/RequestGetAttributeDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class RequestGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTes
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
1515
// path to a file with actual asserts of expected types:
16-
yield from $this->gatherAssertTypes(__DIR__ . '/data/request-get-attribute-return-types.php');
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/request-get-attribute-return-types.php');
1717
}
1818

1919
/**

tests/Unit/Type/SiteGetAttributeDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class SiteGetAttributeDynamicReturnTypeExtensionTest extends TypeInferenceTestCa
1010
/**
1111
* @return iterable<mixed>
1212
*/
13-
public function dataFileAsserts(): iterable
13+
public static function dataFileAsserts(): iterable
1414
{
1515
// path to a file with actual asserts of expected types:
16-
yield from $this->gatherAssertTypes(__DIR__ . '/data/site-get-attribute-return-types.php');
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/site-get-attribute-return-types.php');
1717
}
1818

1919
/**

tests/Unit/Type/UserAspectGetDynamicReturnTypeExtension/UserAspectGetDynamicReturnTypeExtensionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ final class UserAspectGetDynamicReturnTypeExtensionTest extends TypeInferenceTes
1111
*
1212
* @return iterable<mixed>
1313
*/
14-
public function dataFileAsserts(): iterable
14+
public static function dataFileAsserts(): iterable
1515
{
16-
yield from $this->gatherAssertTypes(__DIR__ . '/data/user-aspect-get-return-types.php');
16+
yield from self::gatherAssertTypes(__DIR__ . '/data/user-aspect-get-return-types.php');
1717
}
1818

1919
/**

0 commit comments

Comments
 (0)