File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ public function __construct(ArrayShapeItem ...$items)
32
32
$ this ->items = $ items ;
33
33
}
34
34
35
+ /**
36
+ * @return ArrayShapeItem[]
37
+ */
38
+ public function getItems (): array
39
+ {
40
+ return $ this ->items ;
41
+ }
42
+
35
43
public function underlyingType (): Type
36
44
{
37
45
return new Array_ (new Mixed_ (), new ArrayKey ());
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace phpDocumentor \Reflection \PseudoTypes ;
4
+
5
+ use PHPUnit \Framework \TestCase ;
6
+
7
+ class ArrayShapeTest extends TestCase
8
+ {
9
+ /**
10
+ * @covers ::getItems
11
+ */
12
+ public function testExposeItems (): void
13
+ {
14
+ $ item1 = new ArrayShapeItem ('foo ' , new True_ (), false );
15
+ $ item2 = new ArrayShapeItem ('bar ' , new False_ (), true );
16
+
17
+ $ arrayShape = new ArrayShape ($ item1 , $ item2 );
18
+
19
+ $ this ->assertSame ([$ item1 , $ item2 ], $ arrayShape ->getItems ());
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments