@@ -51,7 +51,7 @@ public static function parseItem(Stringable|string $httpValue): array
51
51
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for an item contains invalid characters. ' );
52
52
}
53
53
54
- [$ value , $ offset ] = Parser::parseBareItem ($ itemString );
54
+ [$ value , $ offset ] = Parser::parseValue ($ itemString );
55
55
$ remainder = substr ($ itemString , $ offset );
56
56
if ('' !== $ remainder && !str_contains ($ remainder , '; ' )) {
57
57
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for an item contains invalid characters. ' );
@@ -72,7 +72,7 @@ public static function parseItem(Stringable|string $httpValue): array
72
72
public static function parseParameters (Stringable |string $ httpValue ): array
73
73
{
74
74
$ httpValue = trim ((string ) $ httpValue );
75
- [$ parameters , $ offset ] = Parser::parseContainedParameters ($ httpValue );
75
+ [$ parameters , $ offset ] = Parser::parseParametersValues ($ httpValue );
76
76
if (strlen ($ httpValue ) !== $ offset ) {
77
77
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for Parameters contains invalid characters. ' );
78
78
}
@@ -194,7 +194,7 @@ private static function parseItemOrInnerList(string $httpValue): array
194
194
return self ::parseInnerListValue ($ httpValue );
195
195
}
196
196
197
- [$ item , $ remainder ] = self ::parseContainedItem ($ httpValue );
197
+ [$ item , $ remainder ] = self ::parseItemValue ($ httpValue );
198
198
199
199
return [$ item , strlen ($ httpValue ) - strlen ($ remainder )];
200
200
}
@@ -215,13 +215,13 @@ private static function parseInnerListValue(string $httpValue): array
215
215
216
216
if (') ' === $ remainder [0 ]) {
217
217
$ remainder = substr ($ remainder , 1 );
218
- [$ parameters , $ offset ] = self ::parseContainedParameters ($ remainder );
218
+ [$ parameters , $ offset ] = self ::parseParametersValues ($ remainder );
219
219
$ remainder = substr ($ remainder , $ offset );
220
220
221
221
return [[$ list , $ parameters ], strlen ($ httpValue ) - strlen ($ remainder )];
222
222
}
223
223
224
- [$ list [], $ remainder ] = self ::parseContainedItem ($ remainder );
224
+ [$ list [], $ remainder ] = self ::parseItemValue ($ remainder );
225
225
226
226
if ('' !== $ remainder && !in_array ($ remainder [0 ], [' ' , ') ' ], true )) {
227
227
throw new SyntaxError ("The HTTP textual representation \"$ remainder \" for a inner list is using invalid characters. " );
@@ -236,11 +236,11 @@ private static function parseInnerListValue(string $httpValue): array
236
236
*
237
237
* @return array{0:array{0:SfType, 1:array<string, SfType>}, 1:string}
238
238
*/
239
- private static function parseContainedItem (string $ remainder ): array
239
+ private static function parseItemValue (string $ remainder ): array
240
240
{
241
- [$ value , $ offset ] = self ::parseBareItem ($ remainder );
241
+ [$ value , $ offset ] = self ::parseValue ($ remainder );
242
242
$ remainder = substr ($ remainder , $ offset );
243
- [$ parameters , $ offset ] = self ::parseContainedParameters ($ remainder );
243
+ [$ parameters , $ offset ] = self ::parseParametersValues ($ remainder );
244
244
245
245
return [[$ value , $ parameters ], substr ($ remainder , $ offset )];
246
246
}
@@ -252,7 +252,7 @@ private static function parseContainedItem(string $remainder): array
252
252
*
253
253
* @return array{0:SfType, 1:int}
254
254
*/
255
- private static function parseBareItem (string $ httpValue ): array
255
+ private static function parseValue (string $ httpValue ): array
256
256
{
257
257
return match (true ) {
258
258
'" ' === $ httpValue [0 ] => self ::parseString ($ httpValue ),
@@ -272,7 +272,7 @@ private static function parseBareItem(string $httpValue): array
272
272
*
273
273
* @return array{0:array<string, SfType>, 1:int}
274
274
*/
275
- private static function parseContainedParameters (Stringable |string $ httpValue ): array
275
+ private static function parseParametersValues (Stringable |string $ httpValue ): array
276
276
{
277
277
$ map = [];
278
278
$ httpValue = (string ) $ httpValue ;
@@ -287,7 +287,7 @@ private static function parseContainedParameters(Stringable|string $httpValue):
287
287
if ('' !== $ remainder && '= ' === $ remainder [0 ]) {
288
288
$ remainder = substr ($ remainder , 1 );
289
289
290
- [$ map [$ key ], $ offset ] = self ::parseBareItem ($ remainder );
290
+ [$ map [$ key ], $ offset ] = self ::parseValue ($ remainder );
291
291
$ remainder = substr ($ remainder , $ offset );
292
292
}
293
293
}
0 commit comments