@@ -48,7 +48,7 @@ public static function parseItem(Stringable|string $httpValue): array
48
48
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for an item contains invalid characters. ' );
49
49
}
50
50
51
- [$ value , $ offset ] = Parser::parseValue ($ itemString );
51
+ [$ value , $ offset ] = Parser::extractValue ($ itemString );
52
52
$ remainder = substr ($ itemString , $ offset );
53
53
if ('' !== $ remainder && !str_contains ($ remainder , '; ' )) {
54
54
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for an item contains invalid characters. ' );
@@ -69,7 +69,7 @@ public static function parseItem(Stringable|string $httpValue): array
69
69
public static function parseParameters (Stringable |string $ httpValue ): array
70
70
{
71
71
$ httpValue = trim ((string ) $ httpValue );
72
- [$ parameters , $ offset ] = Parser::parseParametersValues ($ httpValue );
72
+ [$ parameters , $ offset ] = Parser::extractParametersValues ($ httpValue );
73
73
if (strlen ($ httpValue ) !== $ offset ) {
74
74
throw new SyntaxError ('The HTTP textual representation " ' .$ httpValue .'" for Parameters contains invalid characters. ' );
75
75
}
@@ -212,7 +212,7 @@ private static function parseInnerListValue(string $httpValue): array
212
212
213
213
if (') ' === $ remainder [0 ]) {
214
214
$ remainder = substr ($ remainder , 1 );
215
- [$ parameters , $ offset ] = self ::parseParametersValues ($ remainder );
215
+ [$ parameters , $ offset ] = self ::extractParametersValues ($ remainder );
216
216
$ remainder = substr ($ remainder , $ offset );
217
217
218
218
return [[$ list , $ parameters ], strlen ($ httpValue ) - strlen ($ remainder )];
@@ -235,9 +235,9 @@ private static function parseInnerListValue(string $httpValue): array
235
235
*/
236
236
private static function parseItemValue (string $ remainder ): array
237
237
{
238
- [$ value , $ offset ] = self ::parseValue ($ remainder );
238
+ [$ value , $ offset ] = self ::extractValue ($ remainder );
239
239
$ remainder = substr ($ remainder , $ offset );
240
- [$ parameters , $ offset ] = self ::parseParametersValues ($ remainder );
240
+ [$ parameters , $ offset ] = self ::extractParametersValues ($ remainder );
241
241
242
242
return [[$ value , $ parameters ], substr ($ remainder , $ offset )];
243
243
}
@@ -249,7 +249,7 @@ private static function parseItemValue(string $remainder): array
249
249
*
250
250
* @return array{0:SfType, 1:int}
251
251
*/
252
- private static function parseValue (string $ httpValue ): array
252
+ private static function extractValue (string $ httpValue ): array
253
253
{
254
254
return match (true ) {
255
255
'" ' === $ httpValue [0 ] => self ::parseString ($ httpValue ),
@@ -269,7 +269,7 @@ private static function parseValue(string $httpValue): array
269
269
*
270
270
* @return array{0:array<string, SfType>, 1:int}
271
271
*/
272
- private static function parseParametersValues (Stringable |string $ httpValue ): array
272
+ private static function extractParametersValues (Stringable |string $ httpValue ): array
273
273
{
274
274
$ map = [];
275
275
$ httpValue = (string ) $ httpValue ;
@@ -284,7 +284,7 @@ private static function parseParametersValues(Stringable|string $httpValue): arr
284
284
if ('' !== $ remainder && '= ' === $ remainder [0 ]) {
285
285
$ remainder = substr ($ remainder , 1 );
286
286
287
- [$ map [$ key ], $ offset ] = self ::parseValue ($ remainder );
287
+ [$ map [$ key ], $ offset ] = self ::extractValue ($ remainder );
288
288
$ remainder = substr ($ remainder , $ offset );
289
289
}
290
290
}
0 commit comments