@@ -27,35 +27,35 @@ public static function provideRenderParameter(): iterable
27
27
{
28
28
$ from = static fn (\Closure $ closure ): \ReflectionParameter => new \ReflectionParameter ($ closure , 0 );
29
29
30
- yield [$ from (fn ($ string ) => 0 ), '$string ' ];
31
- yield [$ from (fn ($ string = '' ) => 0 ), '$string = \'\'' ];
32
- yield [$ from (fn (string $ string = "\n\\' \"" ) => 0 ), "mixed \$string = ' \n\\\\\\' \"' " ];
33
- yield [$ from (fn (string $ string = '123 ' ) => 0 ), 'mixed $string = \'123 \'' ];
34
- yield [$ from (fn (string $ string = self ::STRING_CONST ) => 0 ), 'mixed $string = self::STRING_CONST ' ];
30
+ yield [$ from (static fn ($ string ) => 0 ), '$string ' ];
31
+ yield [$ from (static fn ($ string = '' ) => 0 ), '$string = \'\'' ];
32
+ yield [$ from (static fn (string $ string = "\n\\' \"" ) => 0 ), "mixed \$string = ' \n\\\\\\' \"' " ];
33
+ yield [$ from (static fn (string $ string = '123 ' ) => 0 ), 'mixed $string = \'123 \'' ];
34
+ yield [$ from (static fn (string $ string = self ::STRING_CONST ) => 0 ), 'mixed $string = self::STRING_CONST ' ];
35
35
yield [
36
- $ from (fn (string $ string = ProxyClassRendererTest::STRING_CONST ) => 0 ),
36
+ $ from (static fn (string $ string = ProxyClassRendererTest::STRING_CONST ) => 0 ),
37
37
'mixed $string = \\' . self ::class . '::STRING_CONST ' ,
38
38
];
39
- yield [$ from (fn (string |int $ string = self ::INT_CONST ) => 0 ), 'mixed $string = self::INT_CONST ' ];
40
- yield [$ from (fn (mixed $ string = 42 ) => 0 ), 'mixed $string = 42 ' ];
41
- yield [$ from (fn (int $ string = 42 ) => 0 ), 'mixed $string = 42 ' ];
42
- yield [$ from (fn (float $ string = 42 ) => 0 ), 'mixed $string = 42.0 ' ];
43
- yield [$ from (fn (?bool $ string = false ) => 0 ), 'mixed $string = false ' ];
44
- yield [$ from (fn (bool |null $ string = true ) => 0 ), 'mixed $string = true ' ];
45
- yield [$ from (fn (?object $ string = null ) => 0 ), 'mixed $string = NULL ' ];
46
- yield [$ from (fn (?iterable $ string = null ) => 0 ), 'mixed $string = NULL ' ];
47
- yield [$ from (fn (\Countable &\ArrayAccess $ val ) => 0 ), 'mixed $val ' ];
48
- yield [$ from (fn (string ...$ val ) => 0 ), 'mixed ...$val ' ];
49
- yield [$ from (fn (string |int ...$ val ) => 0 ), 'mixed ...$val ' ];
50
- yield [$ from (fn (string |int &$ link ) => 0 ), 'mixed &$link ' ];
39
+ yield [$ from (static fn (string |int $ string = self ::INT_CONST ) => 0 ), 'mixed $string = self::INT_CONST ' ];
40
+ yield [$ from (static fn (mixed $ string = 42 ) => 0 ), 'mixed $string = 42 ' ];
41
+ yield [$ from (static fn (int $ string = 42 ) => 0 ), 'mixed $string = 42 ' ];
42
+ yield [$ from (static fn (float $ string = 42 ) => 0 ), 'mixed $string = 42.0 ' ];
43
+ yield [$ from (static fn (?bool $ string = false ) => 0 ), 'mixed $string = false ' ];
44
+ yield [$ from (static fn (bool |null $ string = true ) => 0 ), 'mixed $string = true ' ];
45
+ yield [$ from (static fn (?object $ string = null ) => 0 ), 'mixed $string = NULL ' ];
46
+ yield [$ from (static fn (?iterable $ string = null ) => 0 ), 'mixed $string = NULL ' ];
47
+ yield [$ from (static fn (\Countable &\ArrayAccess $ val ) => 0 ), 'mixed $val ' ];
48
+ yield [$ from (static fn (string ...$ val ) => 0 ), 'mixed ...$val ' ];
49
+ yield [$ from (static fn (string |int ...$ val ) => 0 ), 'mixed ...$val ' ];
50
+ yield [$ from (static fn (string |int &$ link ) => 0 ), 'mixed &$link ' ];
51
51
yield [$ from (self ::withSelf (...)), 'mixed $self = new self() ' ];
52
- yield [$ from (fn (object $ link = new \stdClass ()) => 0 ), 'mixed $link = new \stdClass() ' ];
52
+ yield [$ from (static fn (object $ link = new \stdClass ()) => 0 ), 'mixed $link = new \stdClass() ' ];
53
53
yield [
54
- $ from (fn (#[Proxy] float |int |\stdClass |null $ string = new \stdClass (1 , 2 , bar: "\n'zero " )) => 0 ),
54
+ $ from (static fn (#[Proxy] float |int |\stdClass |null $ string = new \stdClass (1 , 2 , bar: "\n'zero " )) => 0 ),
55
55
"mixed \$string = new \stdClass(1, 2, bar: ' \n\'zero') " ,
56
56
];
57
57
yield [
58
- $ from (fn (SimpleEnum $ val = SimpleEnum::B) => 0 ),
58
+ $ from (static fn (SimpleEnum $ val = SimpleEnum::B) => 0 ),
59
59
\sprintf ('mixed $val = \%s::B ' , SimpleEnum::class),
60
60
];
61
61
}
@@ -95,23 +95,23 @@ public static function provideRenderParameterTypes(): iterable
95
95
{
96
96
$ from = static fn (\Closure $ closure ): \ReflectionParameter => new \ReflectionParameter ($ closure , 0 );
97
97
98
- yield [$ from (fn (string $ string ) => 0 ), 'string ' ];
99
- yield [$ from (fn (string |int $ string ) => 0 ), 'string|int ' ];
100
- yield [$ from (fn (mixed $ string ) => 0 ), 'mixed ' ];
101
- yield [$ from (fn (int $ string ) => 0 ), 'int ' ];
102
- yield [$ from (fn (float $ string ) => 0 ), 'float ' ];
103
- yield [$ from (fn (?bool $ string ) => 0 ), '?bool ' ];
104
- yield [$ from (fn (bool |null $ string ) => 0 ), '?bool ' ];
105
- yield [$ from (fn (object $ string ) => 0 ), 'object ' ];
106
- yield [$ from (fn (iterable $ string ) => 0 ), 'iterable ' ];
107
- yield [$ from (fn (\Countable &\ArrayAccess $ val ) => 0 ), '\Countable&\ArrayAccess ' ];
108
- yield [$ from (fn (string ...$ val ) => 0 ), 'string ' ];
109
- yield [$ from (fn (string |int ...$ val ) => 0 ), 'string|int ' ];
110
- yield [$ from (fn (string |int &$ link ) => 0 ), 'string|int ' ];
98
+ yield [$ from (static fn (string $ string ) => 0 ), 'string ' ];
99
+ yield [$ from (static fn (string |int $ string ) => 0 ), 'string|int ' ];
100
+ yield [$ from (static fn (mixed $ string ) => 0 ), 'mixed ' ];
101
+ yield [$ from (static fn (int $ string ) => 0 ), 'int ' ];
102
+ yield [$ from (static fn (float $ string ) => 0 ), 'float ' ];
103
+ yield [$ from (static fn (?bool $ string ) => 0 ), '?bool ' ];
104
+ yield [$ from (static fn (bool |null $ string ) => 0 ), '?bool ' ];
105
+ yield [$ from (static fn (object $ string ) => 0 ), 'object ' ];
106
+ yield [$ from (static fn (iterable $ string ) => 0 ), 'iterable ' ];
107
+ yield [$ from (static fn (\Countable &\ArrayAccess $ val ) => 0 ), '\Countable&\ArrayAccess ' ];
108
+ yield [$ from (static fn (string ...$ val ) => 0 ), 'string ' ];
109
+ yield [$ from (static fn (string |int ...$ val ) => 0 ), 'string|int ' ];
110
+ yield [$ from (static fn (string |int &$ link ) => 0 ), 'string|int ' ];
111
111
yield [$ from (self ::withSelf (...)), '\\' . self ::class];
112
- yield [$ from (fn (object $ link ) => 0 ), 'object ' ];
113
- yield [$ from (fn (#[Proxy] float |int |\stdClass |null $ string ) => 0 ), '\stdClass|int|float|null ' ];
114
- yield [$ from (fn (SimpleEnum $ val ) => 0 ), '\\' . SimpleEnum::class];
112
+ yield [$ from (static fn (object $ link ) => 0 ), 'object ' ];
113
+ yield [$ from (static fn (#[Proxy] float |int |\stdClass |null $ string ) => 0 ), '\stdClass|int|float|null ' ];
114
+ yield [$ from (static fn (SimpleEnum $ val ) => 0 ), '\\' . SimpleEnum::class];
115
115
}
116
116
117
117
public function testInterfaceWithConstructor (): void
@@ -144,12 +144,12 @@ public function testRenderParameter(\ReflectionParameter $param, $expected): voi
144
144
}
145
145
146
146
/**
147
- * @dataProvider provideRenderMethod
148
147
* @covers ::renderMethod
149
148
* @covers ::renderParameter
150
149
* @covers ::renderParameterTypes
151
150
* @param mixed $expected
152
151
*/
152
+ #[DataProvider('provideRenderMethod ' )]
153
153
public function testRenderMethod (\ReflectionMethod $ param , $ expected ): void
154
154
{
155
155
$ rendered = ProxyClassRenderer::renderMethod ($ param );
0 commit comments