@@ -19,22 +19,22 @@ class MyPresenter
1919 }
2020
2121
22- public function hints (int $ int , bool $ bool , string $ str , array $ arr )
22+ public function hints (int $ int , bool $ bool , string $ str , array $ arr, iterable $ iter )
2323 {
2424 }
2525
2626
27- public function hintsNulls (int $ int = null , bool $ bool = null , string $ str = null , array $ arr = null )
27+ public function hintsNulls (int $ int = null , bool $ bool = null , string $ str = null , array $ arr = null , iterable $ iter = null )
2828 {
2929 }
3030
3131
32- public function hintsNullable (?int $ int , ?bool $ bool , ?string $ str , ?array $ arr )
32+ public function hintsNullable (?int $ int , ?bool $ bool , ?string $ str , ?array $ arr, ? iterable $ iter )
3333 {
3434 }
3535
3636
37- public function hintsDefaults (int $ int = 0 , bool $ bool = false , string $ str = '' , array $ arr = [])
37+ public function hintsDefaults (int $ int = 0 , bool $ bool = false , string $ str = '' , array $ arr = [], iterable $ iter = [] )
3838 {
3939 }
4040
@@ -68,8 +68,8 @@ test(function () {
6868test (function () {
6969 $ method = new ReflectionMethod ('MyPresenter ' , 'hints ' );
7070
71- Assert::same ([1 , true , 'abc ' , [1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ]]));
72- Assert::same ([0 , false , '' , []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' ])); // missing 'arr'
71+ Assert::same ([1 , true , 'abc ' , [1 ], [ 2 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ], ' iter ' => [ 2 ]]));
72+ Assert::same ([0 , false , '' , [], []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' ])); // missing 'arr', 'iter '
7373
7474 Assert::exception (function () use ($ method ) {
7575 Reflection::combineArgs ($ method , []);
@@ -104,10 +104,10 @@ test(function () {
104104test (function () {
105105 $ method = new ReflectionMethod ('MyPresenter ' , 'hintsNulls ' );
106106
107- Assert::same ([null , null , null , null ], Reflection::combineArgs ($ method , []));
108- Assert::same ([null , null , null , null ], Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null ]));
109- Assert::same ([1 , true , 'abc ' , [1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ]]));
110- Assert::same ([0 , false , '' , []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => []]));
107+ Assert::same ([null , null , null , null , null ], Reflection::combineArgs ($ method , []));
108+ Assert::same ([null , null , null , null , null ], Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null , ' iter ' => null ]));
109+ Assert::same ([1 , true , 'abc ' , [1 ], [ 1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [ 1 ], ' iter ' => [1 ]]));
110+ Assert::same ([0 , false , '' , [], []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => [], ' iter ' => []]));
111111
112112 Assert::exception (function () use ($ method ) {
113113 Reflection::combineArgs ($ method , ['int ' => '' ]);
@@ -134,10 +134,10 @@ test(function () {
134134test (function () {
135135 $ method = new ReflectionMethod ('MyPresenter ' , 'hintsNullable ' );
136136
137- Assert::same ([null , null , null , null ], Reflection::combineArgs ($ method , []));
138- Assert::same ([null , null , null , null ], Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null ]));
139- Assert::same ([1 , true , 'abc ' , [1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ]]));
140- Assert::same ([0 , false , '' , []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => []]));
137+ Assert::same ([null , null , null , null , null ], Reflection::combineArgs ($ method , []));
138+ Assert::same ([null , null , null , null , null ], Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null , ' iter ' => null ]));
139+ Assert::same ([1 , true , 'abc ' , [1 ], [ 1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [ 1 ], ' iter ' => [1 ]]));
140+ Assert::same ([0 , false , '' , [], []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => [], ' iter ' => []]));
141141
142142 Assert::exception (function () use ($ method ) {
143143 Reflection::combineArgs ($ method , ['int ' => '' ]);
@@ -164,10 +164,10 @@ test(function () {
164164test (function () {
165165 $ method = new ReflectionMethod ('MyPresenter ' , 'hintsDefaults ' );
166166
167- Assert::same ([0 , false , '' , []], Reflection::combineArgs ($ method , []));
168- Assert::same ([0 , false , '' , []] , Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null ]));
169- Assert::same ([1 , true , 'abc ' , [1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ]]));
170- Assert::same ([0 , false , '' , []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => []]));
167+ Assert::same ([0 , false , '' , [], [] ], Reflection::combineArgs ($ method , []));
168+ Assert::same ([0 , false , '' , [], []] , Reflection::combineArgs ($ method , ['int ' => null , 'bool ' => null , 'str ' => null , 'arr ' => null , ' iter ' => null ]));
169+ Assert::same ([1 , true , 'abc ' , [1 ], [ 1 ]] , Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [ 1 ], ' iter ' => [1 ]]));
170+ Assert::same ([0 , false , '' , [], []] , Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => false , 'str ' => '' , 'arr ' => [], ' iter ' => []]));
171171
172172 Assert::exception (function () use ($ method ) {
173173 Reflection::combineArgs ($ method , ['int ' => '' ]);
0 commit comments