From 81284895e014875f405a33b8c1478fb5ba4ec964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Lam=C3=A9?= Date: Wed, 15 Nov 2023 22:06:10 +0000 Subject: [PATCH 1/4] Add getter to ArrayShape --- src/PseudoTypes/ArrayShape.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PseudoTypes/ArrayShape.php b/src/PseudoTypes/ArrayShape.php index 48e66f0..e827ffb 100644 --- a/src/PseudoTypes/ArrayShape.php +++ b/src/PseudoTypes/ArrayShape.php @@ -32,6 +32,14 @@ public function __construct(ArrayShapeItem ...$items) $this->items = $items; } + /** + * @return ArrayShapeItem[] + */ + public function getItems(): array + { + return $this->items; + } + public function underlyingType(): Type { return new Array_(new Mixed_(), new ArrayKey()); From 7aae003c8defee5362b1c8a96b2609190187ad7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Lam=C3=A9?= Date: Fri, 24 Nov 2023 17:20:58 +0100 Subject: [PATCH 2/4] Add ArrayShapeTest --- tests/unit/PseudoTypes/ArrayShapeTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/unit/PseudoTypes/ArrayShapeTest.php diff --git a/tests/unit/PseudoTypes/ArrayShapeTest.php b/tests/unit/PseudoTypes/ArrayShapeTest.php new file mode 100644 index 0000000..04af1fc --- /dev/null +++ b/tests/unit/PseudoTypes/ArrayShapeTest.php @@ -0,0 +1,23 @@ +assertSame([$item1, $item2], $arrayShape->getItems()); + } +} \ No newline at end of file From 3ac1b5e13c033fd05292464fe4739bbf394a1a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Lam=C3=A9?= Date: Fri, 24 Nov 2023 17:23:01 +0100 Subject: [PATCH 3/4] Add missing imports --- tests/unit/PseudoTypes/ArrayShapeTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/PseudoTypes/ArrayShapeTest.php b/tests/unit/PseudoTypes/ArrayShapeTest.php index 04af1fc..0ab4088 100644 --- a/tests/unit/PseudoTypes/ArrayShapeTest.php +++ b/tests/unit/PseudoTypes/ArrayShapeTest.php @@ -4,6 +4,8 @@ use phpDocumentor\Reflection\PseudoTypes\ArrayShape; use phpDocumentor\Reflection\PseudoTypes\ArrayShapeItem; +use phpDocumentor\Reflection\PseudoTypes\False_; +use phpDocumentor\Reflection\PseudoTypes\True_; use PHPUnit\Framework\TestCase; class ArrayShapeTest extends TestCase From 029d5bf7bdfd2d0ca3c257df3b48b5a2bf79a6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Lam=C3=A9?= Date: Fri, 24 Nov 2023 17:29:50 +0100 Subject: [PATCH 4/4] Fix style --- tests/unit/PseudoTypes/ArrayShapeTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/unit/PseudoTypes/ArrayShapeTest.php b/tests/unit/PseudoTypes/ArrayShapeTest.php index 0ab4088..314d030 100644 --- a/tests/unit/PseudoTypes/ArrayShapeTest.php +++ b/tests/unit/PseudoTypes/ArrayShapeTest.php @@ -2,10 +2,6 @@ namespace phpDocumentor\Reflection\PseudoTypes; -use phpDocumentor\Reflection\PseudoTypes\ArrayShape; -use phpDocumentor\Reflection\PseudoTypes\ArrayShapeItem; -use phpDocumentor\Reflection\PseudoTypes\False_; -use phpDocumentor\Reflection\PseudoTypes\True_; use PHPUnit\Framework\TestCase; class ArrayShapeTest extends TestCase