Skip to content

Commit 514e772

Browse files
committed
static data providers
1 parent b5df7e8 commit 514e772

25 files changed

+33
-33
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerDesCacheWarmerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testWarmUpTemplate(array $expectedClasses, bool $nullableData)
6767
/**
6868
* @return iterable<array{0: list<string>, 1: bool}>
6969
*/
70-
public function warmUpTemplateDataProvider(): iterable
70+
public static function warmUpTemplateDataProvider(): iterable
7171
{
7272
yield [[DummyWithMethods::class, '?'.DummyWithQuotes::class, ClassicDummy::class], false];
7373
yield [[DummyWithMethods::class, '?'.DummyWithQuotes::class, '?'.ClassicDummy::class], true];

src/Symfony/Component/SerDes/Tests/Hook/Deserialize/ObjectHookTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testAddGenericParameterTypes(array $expectedGenericParameterType
3838
/**
3939
* @return iterable<array{0: array<class-string, array<string, string>>, 1: string, 2: list<string>}>
4040
*/
41-
public function addGenericParameterTypesDataProvider(): iterable
41+
public static function addGenericParameterTypesDataProvider(): iterable
4242
{
4343
yield [[], 'int', []];
4444
yield [[], 'Foo<int>', ['T']];

src/Symfony/Component/SerDes/Tests/Hook/Serialize/ObjectHookTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testAddGenericParameterTypes(array $expectedGenericParameterType
3838
/**
3939
* @return iterable<array{0: array<class-string, array<string, string>>, 1: string, 2: list<string>}>
4040
*/
41-
public function addGenericParameterTypesDataProvider(): iterable
41+
public static function addGenericParameterTypesDataProvider(): iterable
4242
{
4343
yield [[], 'int', []];
4444
yield [[], 'Foo<int>', ['T']];

src/Symfony/Component/SerDes/Tests/Hook/Serialize/PropertyHookTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testUpdateName(string $expectedName, array $propertyNames)
4646
/**
4747
* @return iterable<array{0: string, 1: array<class-string, array<string, string>>}>
4848
*/
49-
public function updateNameDataProvider(): iterable
49+
public static function updateNameDataProvider(): iterable
5050
{
5151
yield ['id', []];
5252
yield ['id', [ClassicDummy::class => ['name' => 'identifier']]];
@@ -81,7 +81,7 @@ public function testUpdateTypeAccessorAndContextFromFormatter(string $expectedTy
8181
/**
8282
* @return iterable<array{0: string, 1: array<class-string, array<string, callable>}>>
8383
*/
84-
public function updateTypeAccessorAndContextFromFormatterDataProvider(): iterable
84+
public static function updateTypeAccessorAndContextFromFormatterDataProvider(): iterable
8585
{
8686
yield ['int', '$accessor', []];
8787
yield ['int', '$accessor', [ClassicDummy::class => ['name' => DummyWithMethods::doubleAndCastToString(...)]]];
@@ -118,7 +118,7 @@ public function testThrowWhenWrongFormatter(string $exceptionMessage, callable $
118118
/**
119119
* @return iterable<array{0: string, 1: callable}>
120120
*/
121-
public function throwWhenWrongFormatterDataProvider(): iterable
121+
public static function throwWhenWrongFormatterDataProvider(): iterable
122122
{
123123
yield [
124124
sprintf('Property formatter "%s::$id" must be a static method.', ClassicDummy::class),

src/Symfony/Component/SerDes/Tests/Internal/Deserialize/Json/DeserializeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testDeserialize(string $json, string $type)
3131
/**
3232
* @return iterable<array{0: string, 1: string}>
3333
*/
34-
public function deserializeDataProvider(): iterable
34+
public static function deserializeDataProvider(): iterable
3535
{
3636
yield ['1', 'int'];
3737
yield ['"foo"', 'string'];

src/Symfony/Component/SerDes/Tests/Internal/Deserialize/Json/JsonDictSplitterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testSplit(array $expectedBoundaries, array $tokens)
5050
/**
5151
* @return iterable<array{0: list<array{0: int, 1: int}>, 1: list<array{0: string, 1: int}>}>
5252
*/
53-
public function splitDataProvider(): iterable
53+
public static function splitDataProvider(): iterable
5454
{
5555
yield [[], [['{', 0], ['}', 1]]];
5656
yield [['k' => [5, 2]], [['{', 0], ['"k"', 1], [':', 4], ['10', 5], ['}', 7]]];
@@ -77,7 +77,7 @@ public function testSplitInvalidThrowException(array $tokens)
7777
/**
7878
* @return iterable<array{0: list<array{0: string, 1: int}>}>
7979
*/
80-
public function splitInvalidDataProvider(): iterable
80+
public static function splitInvalidDataProvider(): iterable
8181
{
8282
yield [[['{', 0], ['100', 1]]];
8383
yield [[['{', 0], ['{', 1], ['}', 2]]];

src/Symfony/Component/SerDes/Tests/Internal/Deserialize/Json/JsonLexerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testTokens(array $expectedTokens, string $content)
3030
/**
3131
* @return iterable<array{0: list<string>, 1: string}>
3232
*/
33-
public function tokensDataProvider(): iterable
33+
public static function tokensDataProvider(): iterable
3434
{
3535
yield [[['1', 0]], '1'];
3636
yield [[['false', 0]], 'false'];

src/Symfony/Component/SerDes/Tests/Internal/Deserialize/Json/JsonListSplitterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testSplit(array $expectedBoundaries, array $tokens)
5050
/**
5151
* @return iterable<array{0: list<array{0: int, 1: int}>, 1: list<array{0: string, 1: int}>}>
5252
*/
53-
public function splitDataProvider(): iterable
53+
public static function splitDataProvider(): iterable
5454
{
5555
yield [[], [['[', 0], [']', 1]]];
5656
yield [[[1, 3]], [['[', 0], ['100', 1], [']', 4]]];
@@ -79,7 +79,7 @@ public function testSplitInvalidThrowException(array $tokens)
7979
/**
8080
* @return iterable<array{0: list<array{0: string, 1: int}>}>
8181
*/
82-
public function splitInvalidDataProvider(): iterable
82+
public static function splitInvalidDataProvider(): iterable
8383
{
8484
yield [[['[', 0], ['100', 1]]];
8585
yield [[['[', 0], ['[', 1], [']', 2]]];

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Json/SerializeGenerateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testSerializeGenerate(string $expectedSource, string $type, arra
3232
/**
3333
* @return iterable<array{0: string, 1: string, 2: array<string, mixed>}>
3434
*/
35-
public function serializeGenerateDataProvider(): iterable
35+
public static function serializeGenerateDataProvider(): iterable
3636
{
3737
yield [
3838
<<<PHP

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Json/SerializeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testSerialize(mixed $data, string $type = null)
4545
/**
4646
* @return iterable<array{0: mixed, 1: string?}>
4747
*/
48-
public function serializeDataProvider(): iterable
48+
public static function serializeDataProvider(): iterable
4949
{
5050
yield [1];
5151
yield ['1'];

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Node/ClosureNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testCompile(string $expectedSource, ArgumentsNode $arguments, ?s
3535
/**
3636
* @return iterable<array{0: string, 1: ArgumentsNode, 2: ?string, 3: bool, 4: list<NodeInterface>}>
3737
*/
38-
public function compileDataProvider(): iterable
38+
public static function compileDataProvider(): iterable
3939
{
4040
yield [
4141
<<<PHP

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Node/ForEachNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testCompile(string $expectedSource, NodeInterface $collection, ?
3535
/**
3636
* @return iterable<array{0: string, 1: NodeInterface, 2: ?string, 3: string, 4: list<NodeInterface>}>
3737
*/
38-
public function compileDataProvider(): iterable
38+
public static function compileDataProvider(): iterable
3939
{
4040
yield [
4141
<<<PHP

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Node/IfNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testCompile(string $expectedSource, NodeInterface $condition, ar
3737
/**
3838
* @return iterable<array{0: string, 1: NodeInterface, 2: list<NodeInterface>, 3: list<NodeInterface>, 4: list<array{condition: NodeInterface, body: list<NodeInterface>}>}>
3939
*/
40-
public function compileDataProvider(): iterable
40+
public static function compileDataProvider(): iterable
4141
{
4242
yield [
4343
<<<PHP

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Node/ScalarNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testCompile(string $expectedSource, mixed $scalar)
3030
/**
3131
* @return iterable<array{0: string, 1: mixed}>
3232
*/
33-
public function compileDataProvider(): iterable
33+
public static function compileDataProvider(): iterable
3434
{
3535
yield ['null', null];
3636
yield ['123', 123];

src/Symfony/Component/SerDes/Tests/Internal/Serialize/Node/TemplateStringNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testCompile(string $expectedSource, array $parts)
3232
/**
3333
* @return iterable<array{0: string, 1: list<string|VariableNode>}>
3434
*/
35-
public function compileDataProvider(): iterable
35+
public static function compileDataProvider(): iterable
3636
{
3737
yield ['""', []];
3838
yield ['"foobar"', ['foo', 'bar']];

src/Symfony/Component/SerDes/Tests/Internal/Serialize/OptimizerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testMergeStringFwrites(array $expectedNodes, array $nodes)
3535
/**
3636
* @return iterable<array{0: list<NodeInterface>, 1: list<NodeInterface>}>
3737
*/
38-
public function mergeStringFwritesDataProvider(): iterable
38+
public static function mergeStringFwritesDataProvider(): iterable
3939
{
4040
$createFwriteExpression = fn (NodeInterface $content) => new ExpressionNode(new FunctionNode('\fwrite', [new VariableNode('resource'), $content]));
4141

src/Symfony/Component/SerDes/Tests/Internal/Serialize/SerializeGenerateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testCheckForCircularReferences(?string $expectedCircularClassNam
4141
/**
4242
* @return iterable<array{0: ?string, 1: string}>
4343
*/
44-
public function checkForCircularReferencesDataProvider(): iterable
44+
public static function checkForCircularReferencesDataProvider(): iterable
4545
{
4646
yield [null, ClassicDummy::class];
4747
yield [null, sprintf('array<int, %s>', ClassicDummy::class)];

src/Symfony/Component/SerDes/Tests/Internal/Serialize/TypeSorterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testSortByPrecision(array $expectedSortedTypes, array $types)
3636
/**
3737
* @return iterable<array{0: list<string>, 1: list<string>}
3838
*/
39-
public function sortByPrecisionDataProvider(): iterable
39+
public static function sortByPrecisionDataProvider(): iterable
4040
{
4141
yield [['int', 'string'], ['int', 'string']];
4242
yield [['int'], ['int', 'int']];
@@ -67,7 +67,7 @@ public function testThrowIfSameHierarchicalLevel(bool $expectException, array $t
6767
/**
6868
* @return iterable<array{0: bool, 1: list<Type>}
6969
*/
70-
public function throwIfSameHierarchicalLevelDataProvider(): iterable
70+
public static function throwIfSameHierarchicalLevelDataProvider(): iterable
7171
{
7272
yield [false, [new Type('object', className: Leaf::class), new Type('int')]];
7373
yield [false, [new Type('object', className: Branch::class), new Type('object', className: Root::class), new Type('object', className: Leaf::class)]];

src/Symfony/Component/SerDes/Tests/Internal/SerializeDeserializeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testSerializeDeserialize(mixed $data, string $type, array $conte
5454
/**
5555
* @return iterable<array{0: mixed, 1: string, 2: array<string, mixed>}>
5656
*/
57-
public function serializeDeserializeDataProvider(): iterable
57+
public static function serializeDeserializeDataProvider(): iterable
5858
{
5959
yield [1, 'int'];
6060
yield [null, '?int'];
@@ -111,7 +111,7 @@ public function testDeserializeSerialize(string $content, string $type, array $c
111111
/**
112112
* @return iterable<array{0: string, 1: string, 2: array<string, mixed>}>
113113
*/
114-
public function deserializeSerializeDataProvider(): iterable
114+
public static function deserializeSerializeDataProvider(): iterable
115115
{
116116
yield ['1', 'int'];
117117
yield ['null', '?int'];

src/Symfony/Component/SerDes/Tests/Internal/TypeFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testCreateFromString(Type|UnionType $expectedType, string $strin
3535
/**
3636
* @return iterable<array{0: Type|UnionType, 1: string}>
3737
*/
38-
public function createFromStringDataProvider(): iterable
38+
public static function createFromStringDataProvider(): iterable
3939
{
4040
// scalar types
4141
yield [new Type('null'), 'null'];

src/Symfony/Component/SerDes/Tests/Internal/TypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testToString(string $expectedString, Type|UnionType $type)
3232
/**
3333
* @return iterable<array{0: string, 1: Type|UnionType}>
3434
*/
35-
public function toStringDataProvider(): iterable
35+
public static function toStringDataProvider(): iterable
3636
{
3737
// scalar types
3838
yield ['null', new Type('null')];
@@ -163,7 +163,7 @@ public function testIsser(Type $type, bool $scalar, bool $nullable, bool $object
163163
/**
164164
* @return iterable<array{type: Type, scalar: bool, null: bool, object: bool, collection: bool, list: bool, dict: bool}>
165165
*/
166-
public function isserDataProvider(): iterable
166+
public static function isserDataProvider(): iterable
167167
{
168168
yield ['type' => new Type('int'), 'scalar' => true, 'null' => false, 'object' => false, 'collection' => false, 'list' => false, 'dict' => false, 'generic' => false];
169169
yield ['type' => new Type('string'), 'scalar' => true, 'null' => false, 'object' => false, 'collection' => false, 'list' => false, 'dict' => false, 'generic' => false];

src/Symfony/Component/SerDes/Tests/Internal/UnionTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testToString(string $expectedString, UnionType $type)
4242
/**
4343
* @return iterable<array{0: string, 1: UnionType}>
4444
*/
45-
public function toStringDataProvider(): iterable
45+
public static function toStringDataProvider(): iterable
4646
{
4747
yield ['int|string', new UnionType([new Type('int'), new Type('string')])];
4848
yield ['int|string|null', new UnionType([new Type('int'), new Type('string'), new Type('null')])];

src/Symfony/Component/SerDes/Tests/Type/PhpstanTypeExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testExtractClassTypeFromParameter()
135135
/**
136136
* @return iterable<array{0: string, 1: string, 2: bool}>
137137
*/
138-
public function typesDataProvider(): iterable
138+
public static function typesDataProvider(): iterable
139139
{
140140
yield ['mixed', 'mixed'];
141141
yield ['bool', 'bool'];

src/Symfony/Component/SerDes/Tests/Type/ReflectionTypeExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function testThrowIfCannotFindParameterType()
132132
/**
133133
* @return iterable<array{0: string, 1: string}>
134134
*/
135-
public function typesDataProvider(): iterable
135+
public static function typesDataProvider(): iterable
136136
{
137137
yield ['mixed', 'mixed'];
138138
yield ['int', 'int'];

src/Symfony/Component/SerDes/Tests/Type/TypeGenericsHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testReplaceGenericTypes(string $expectedType, string $type, arra
3030
/**
3131
* @return iterable<array{0: string, 1: string, 2: array<string, string>}>
3232
*/
33-
public function replaceGenericTypesDataProvider(): iterable
33+
public static function replaceGenericTypesDataProvider(): iterable
3434
{
3535
yield ['T', 'T', []];
3636
yield ['Foo', 'T', ['T' => 'Foo']];
@@ -60,7 +60,7 @@ public function testExtractGenerics(string $expectedGenericType, array $expected
6060
/**
6161
* @return iterable<array{0: string, 1: list<string>, 2: string}>
6262
*/
63-
public function extractGenericsDataProvider(): iterable
63+
public static function extractGenericsDataProvider(): iterable
6464
{
6565
yield ['int', [], 'int'];
6666
yield ['Foo', ['int'], 'Foo<int>'];

0 commit comments

Comments
 (0)