@@ -48,7 +48,21 @@ public static function providesToArray(): iterable
4848 ];
4949
5050 yield [
51- 'data ' => [
51+ 'data ' => (static function () {
52+ $ o = new stdClass ();
53+ $ o ->foo = 'bar ' ;
54+ $ o ->debug = true ;
55+
56+ return $ o ;
57+ })(),
58+ 'result ' => [
59+ 'foo ' => 'bar ' ,
60+ 'debug ' => true ,
61+ ],
62+ ];
63+
64+ yield [
65+ 'data ' => [
5266 2 ,
5367 (static function () {
5468 $ o = new stdClass ();
@@ -61,14 +75,14 @@ public static function providesToArray(): iterable
6175 'result ' => [
6276 2 ,
6377 [
64- 'foo ' => 'bar ' ,
78+ 'foo ' => 'bar ' ,
6579 'debug ' => true ,
6680 ],
6781 ],
6882 ];
6983
7084 yield [
71- 'data ' => new class implements Arrayable {
85+ 'data ' => new class implements Arrayable {
7286 /**
7387 * @return array<mixed>
7488 */
@@ -81,7 +95,7 @@ public function __toArray(): array
8195 ];
8296
8397 yield [
84- 'data ' => new class implements CoreArrayable {
98+ 'data ' => new class implements CoreArrayable {
8599 /**
86100 * @return array<mixed>
87101 */
@@ -94,20 +108,20 @@ public function __toArray(): array
94108 ];
95109
96110 yield [
97- 'data ' => new ArrayIterator ([3 , 4 , 5 ]),
111+ 'data ' => new ArrayIterator ([3 , 4 , 5 ]),
98112 'result ' => [3 , 4 , 5 ],
99113 ];
100114
101115 yield [
102- 'data ' => (static function () {
116+ 'data ' => (static function () {
103117 yield 2.3 ;
104118 yield 8.10 ;
105119 })(),
106120 'result ' => [2.3 , 8.10 ],
107121 ];
108122
109123 yield [
110- 'data ' => [
124+ 'data ' => [
111125 1 ,
112126 3 ,
113127 [
@@ -134,32 +148,41 @@ public function __toArray(): array
134148 ];
135149
136150 yield [
137- 'data ' => new ArrayIterator ([1 , new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])])]),
151+ 'data ' => new ArrayIterator ([
152+ 1 ,
153+ new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])]),
154+ ]),
138155 'result ' => [1 , [3 , [4 , [3 , 4 , 5 ]]]],
139156 ];
140157
141158 yield [
142- 'data ' => new ArrayIterator ([1 , new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])])]),
159+ 'data ' => new ArrayIterator ([
160+ 1 ,
161+ new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])]),
162+ ]),
143163 'result ' => [1 , new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])])],
144- 'limit ' => 1 ,
164+ 'limit ' => 1 ,
145165 ];
146166
147167 yield [
148- 'data ' => new ArrayIterator ([1 , new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])])]),
168+ 'data ' => new ArrayIterator ([
169+ 1 ,
170+ new ArrayIterator ([3 , new ArrayIterator ([4 , new ArrayIterator ([3 , 4 , 5 ])])]),
171+ ]),
149172 'result ' => [1 , [3 , [4 , new ArrayIterator ([3 , 4 , 5 ])]]],
150- 'limit ' => 3 ,
173+ 'limit ' => 3 ,
151174 ];
152175
153176 yield [
154- 'data ' => '1 ' ,
177+ 'data ' => '1 ' ,
155178 'result ' => new UnexpectedValueException ('Limit value should be positive number ' ),
156- 'limit ' => -1 ,
179+ 'limit ' => -1 ,
157180 ];
158181
159182 yield [
160- 'data ' => '1 ' ,
183+ 'data ' => '1 ' ,
161184 'result ' => new UnexpectedValueException ('Limit value should be positive number ' ),
162- 'limit ' => 0 ,
185+ 'limit ' => 0 ,
163186 ];
164187 }
165188}
0 commit comments