@@ -17,8 +17,10 @@ final class Parser
17
17
* Returns an OrderedList value object from an HTTP textual representation.
18
18
*
19
19
* @see https://www.rfc-editor.org/rfc/rfc8941.html#section-4.2.1
20
+ *
21
+ * @return array<InnerList|Item|ByteSequence|Token|bool|int|float|string>
20
22
*/
21
- public static function parseList (string $ httpValue ): OrderedList
23
+ public static function parseList (string $ httpValue ): array
22
24
{
23
25
$ members = [];
24
26
$ remainder = ltrim ($ httpValue , ' ' );
@@ -41,15 +43,17 @@ public static function parseList(string $httpValue): OrderedList
41
43
}
42
44
}
43
45
44
- return OrderedList:: fromMembers ( $ members) ;
46
+ return $ members ;
45
47
}
46
48
47
49
/**
48
50
* Returns a Dictionary value object from an HTTP textual representation.
49
51
*
50
52
* @see https://www.rfc-editor.org/rfc/rfc8941.html#section-4.2.2
53
+ *
54
+ * @return array<string, InnerList|Item|ByteSequence|Token|bool|int|float|string>
51
55
*/
52
- public static function parseDictionary (string $ httpValue ): Dictionary
56
+ public static function parseDictionary (string $ httpValue ): array
53
57
{
54
58
$ members = [];
55
59
$ remainder = ltrim ($ httpValue , ' ' );
@@ -78,7 +82,7 @@ public static function parseDictionary(string $httpValue): Dictionary
78
82
}
79
83
}
80
84
81
- return Dictionary:: fromAssociative ( $ members) ;
85
+ return $ members ;
82
86
}
83
87
84
88
/**
@@ -145,8 +149,10 @@ private static function parseBareItem(string &$httpValue): bool|float|int|string
145
149
* Returns a Parameters value object from an HTTP textual representation.
146
150
*
147
151
* @see https://www.rfc-editor.org/rfc/rfc8941.html#section-4.2.3.2
152
+ *
153
+ * @return array<array-key, Item|Token|ByteSequence|float|int|bool|string>
148
154
*/
149
- private static function parseParameters (string &$ httpValue ): Parameters
155
+ private static function parseParameters (string &$ httpValue ): array
150
156
{
151
157
$ parameters = [];
152
158
@@ -162,7 +168,7 @@ private static function parseParameters(string &$httpValue): Parameters
162
168
}
163
169
}
164
170
165
- return Parameters:: fromAssociative ( $ parameters) ;
171
+ return $ parameters ;
166
172
}
167
173
168
174
/**
0 commit comments