14
14
use gapple \Tests \StructuredFields \RulesetTest ;
15
15
use ParagonIE \ConstantTime \Base32 ;
16
16
17
+ /**
18
+ * @phpstan-type ExpectedParameters array<array{string, mixed}>
19
+ * @phpstan-type ExpectedTuple array{mixed, ExpectedParameters}
20
+ * @phpstan-type ExpectedInnerList array{array<ExpectedTuple>, ExpectedParameters}
21
+ * @phpstan-type ExpectedOuterList array<ExpectedTuple>
22
+ * @phpstan-type ExpectedDictionary array<array{string, ExpectedTuple}>
23
+ */
17
24
abstract class HttpwgTest extends RulesetTest
18
25
{
19
26
/**
@@ -67,7 +74,7 @@ protected function rulesetDataProvider(): array
67
74
/**
68
75
* Convert the expected value of an item tuple.
69
76
*
70
- * @param array{mixed, array<array{string, mixed}>} $item
77
+ * @param ExpectedTuple $item
71
78
* @return \gapple\StructuredFields\Item
72
79
*/
73
80
private static function convertExpectedItem (array $ item ): Item
@@ -78,7 +85,7 @@ private static function convertExpectedItem(array $item): Item
78
85
/**
79
86
* Convert the expected values of a parameters map.
80
87
*
81
- * @param array<array{string, mixed}> $parameters
88
+ * @param ExpectedParameters $parameters
82
89
* @return Parameters
83
90
*/
84
91
private static function convertParameters (array $ parameters ): Parameters
@@ -100,7 +107,7 @@ private static function convertParameters(array $parameters): Parameters
100
107
/**
101
108
* Convert the expected values of an inner list tuple.
102
109
*
103
- * @param array{array<array{mixed, array<array{string, mixed}>}>, array<array{string, mixed}>} $innerList
110
+ * @param ExpectedInnerList $innerList
104
111
* @return InnerList
105
112
*/
106
113
private static function convertInnerList (array $ innerList ): InnerList
@@ -117,7 +124,7 @@ private static function convertInnerList(array $innerList): InnerList
117
124
/**
118
125
* Convert the expected values of a list.
119
126
*
120
- * @param array<array{mixed, array<array{string, mixed}>}> $list
127
+ * @param ExpectedOuterList $list
121
128
* @return OuterList
122
129
*/
123
130
private static function convertExpectedList (array $ list ): OuterList
@@ -138,7 +145,7 @@ private static function convertExpectedList(array $list): OuterList
138
145
/**
139
146
* Convert the expected values of a dictionary.
140
147
*
141
- * @param array<array{string, array{mixed, array<array{string, mixed}>}}> $dictionary
148
+ * @param ExpectedDictionary $dictionary
142
149
* @return Dictionary
143
150
*/
144
151
private static function convertExpectedDictionary (array $ dictionary ): Dictionary
0 commit comments