1616use function dom_import_simplexml ;
1717use function str_replace ;
1818
19+ /**
20+ * @phpstan-type DataSetType = list<
21+ * array{
22+ * id: int,
23+ * name: string,
24+ * tree: int,
25+ * type: 'multiple_tree'|'tree',
26+ * lft: int,
27+ * rgt: int,
28+ * depth: int,
29+ * }
30+ * >
31+ */
1932class TestCase extends \PHPUnit \Framework \TestCase
2033{
2134 use SchemaBuilderTrait;
35+
2236 protected string $ fixtureDirectory = __DIR__ . '/support/data/ ' ;
2337
2438 public function getDb (): Connection
@@ -27,9 +41,9 @@ public function getDb(): Connection
2741 }
2842
2943 /**
30- * @phpstan-param array<
31- * array{id: int, name: string, tree: int, type: string, lft: int, rgt: int, depth: int}
32- * > $dataSet
44+ * @phpstan-import-type DataSetType from TestCase
45+ *
46+ * @phpstan-param DataSetType $dataSet
3347 */
3448 protected function buildFlatXMLDataSet (array $ dataSet ): string
3549 {
@@ -111,17 +125,9 @@ protected function createDatabase(): void
111125 }
112126
113127 /**
114- * @phpstan-return list<
115- * array{
116- * id: int,
117- * name: string,
118- * tree: int,
119- * type: string,
120- * lft: int,
121- * rgt: int,
122- * depth: int
123- * }
124- * >
128+ * @phpstan-import-type DataSetType from TestCase
129+ *
130+ * @phpstan-return DataSetType
125131 */
126132 protected function getDataSet (): array
127133 {
@@ -142,17 +148,9 @@ protected function getDataSet(): array
142148 }
143149
144150 /**
145- * @phpstan-return list<
146- * array{
147- * id: int,
148- * name: string,
149- * tree: int,
150- * type: 'multiple_tree',
151- * lft: int,
152- * rgt: int,
153- * depth: int,
154- * }
155- * >
151+ * @phpstan-import-type DataSetType from TestCase
152+ *
153+ * @phpstan-return DataSetType
156154 */
157155 protected function getDataSetMultipleTree (): array
158156 {
0 commit comments