File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * This file is part of CodeIgniter 4 framework.
7+ *
8+ * (c) CodeIgniter Foundation <admin@codeigniter.com>
9+ *
10+ * For the full copyright and license information, please view
11+ * the LICENSE file that was distributed with this source code.
12+ */
13+
14+ namespace Tests \Support \Entity ;
15+
16+ use ArrayObject ;
17+
18+ /**
19+ * @extends ArrayObject<string, string>
20+ */
21+ final class ArrayObjectWithToArray extends ArrayObject
22+ {
23+ /**
24+ * @return array<string, string>
25+ */
26+ public function toArray (): array
27+ {
28+ return ['array ' => 'same ' ];
29+ }
30+ }
Original file line number Diff line number Diff line change 3030use PHPUnit \Framework \Attributes \Group ;
3131use ReflectionException ;
3232use stdClass ;
33+ use Tests \Support \Entity \ArrayObjectWithToArray ;
3334use Tests \Support \Entity \Cast \CastBase64 ;
3435use Tests \Support \Entity \Cast \CastPassParameters ;
3536use Tests \Support \Entity \Cast \NotExtendsBaseCast ;
@@ -2368,16 +2369,7 @@ public function testHasChangedPrefersToArrayOverTraversable(): void
23682369 ];
23692370 };
23702371
2371- /** @extends ArrayObject<string, string> */
2372- $ items = new class (['iterator ' => 'original ' ]) extends ArrayObject {
2373- /**
2374- * @return array<string, string>
2375- */
2376- public function toArray (): array
2377- {
2378- return ['array ' => 'same ' ];
2379- }
2380- };
2372+ $ items = new ArrayObjectWithToArray (['iterator ' => 'original ' ]);
23812373
23822374 $ entity ->items = $ items ;
23832375 $ entity ->syncOriginal ();
You can’t perform that action at this time.
0 commit comments