@@ -98,7 +98,7 @@ public static function fromToken(string|Stringable $value, iterable $parameters
98
98
private static function filterDecimal (float $ value ): float
99
99
{
100
100
if (abs (floor ($ value )) > 999_999_999_999 ) {
101
- throw new SyntaxError ('Integer portion of decimals is limited to 12 digits ' );
101
+ throw new SyntaxError ('Integer portion of decimals is limited to 12 digits. ' );
102
102
}
103
103
104
104
return $ value ;
@@ -126,7 +126,7 @@ private static function filterString(string $value): string
126
126
private static function filterInteger (int $ value ): int
127
127
{
128
128
if ($ value > 999_999_999_999_999 || $ value < -999_999_999_999_999 ) {
129
- throw new SyntaxError ('Integers are limited to 15 digits ' );
129
+ throw new SyntaxError ('Integers are limited to 15 digits. ' );
130
130
}
131
131
132
132
return $ value ;
@@ -186,7 +186,7 @@ private static function parseToken(string $string): array
186
186
private static function parseBoolean (string $ string ): array
187
187
{
188
188
if (1 !== preg_match ('/^\?[01]/ ' , $ string )) {
189
- throw new SyntaxError ("The HTTP textual representation \"$ string \" for a boolean contains invalid characters. " );
189
+ throw new SyntaxError ("The HTTP textual representation \"$ string \" for a Boolean contains invalid characters. " );
190
190
}
191
191
192
192
return [$ string [1 ] === '1 ' , substr ($ string , 2 )];
@@ -200,7 +200,7 @@ private static function parseBoolean(string $string): array
200
200
private static function parseBytesSequence (string $ string ): array
201
201
{
202
202
if (1 !== preg_match ('/^:(?<bytes>[a-z\d+\/=]*):/i ' , $ string , $ matches )) {
203
- throw new SyntaxError ("The HTTP textual representation \"$ string \" for a byte sequence contains invalid characters. " );
203
+ throw new SyntaxError ("The HTTP textual representation \"$ string \" for a Byte sequence contains invalid characters. " );
204
204
}
205
205
206
206
return [ByteSequence::fromEncoded ($ matches ['bytes ' ]), substr ($ string , strlen ($ matches [0 ]))];
@@ -219,13 +219,13 @@ private static function parseNumber(string $string): array
219
219
}
220
220
221
221
if (1 !== preg_match ('/ ' .$ regexp .'/ ' , $ string , $ found )) {
222
- throw new SyntaxError ("The HTTP textual representation \"$ string \" for a number contains invalid characters. " );
222
+ throw new SyntaxError ("The HTTP textual representation \"$ string \" for a Number contains invalid characters. " );
223
223
}
224
224
225
225
$ number = match (true ) {
226
226
1 === preg_match ('/^-?\d{1,12}\.\d{1,3}$/ ' , $ found ['number ' ]) => (float ) $ found ['number ' ],
227
227
1 === preg_match ('/^-?\d{1,15}$/ ' , $ found ['number ' ]) => (int ) $ found ['number ' ],
228
- default => throw new SyntaxError ("The HTTP textual representation \"$ string \" for a number contain too many digits. " ),
228
+ default => throw new SyntaxError ("The HTTP textual representation \"$ string \" for a Number contain too many digits. " ),
229
229
};
230
230
231
231
return [$ number , substr ($ string , strlen ($ found ['number ' ]))];
@@ -256,19 +256,19 @@ private static function parseString(string $string): array
256
256
}
257
257
258
258
if ($ string === '' ) {
259
- throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a string contains an invalid end string. " );
259
+ throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a String contains an invalid end string. " );
260
260
}
261
261
262
262
$ char = $ string [0 ];
263
263
$ string = substr ($ string , 1 );
264
264
if (!in_array ($ char , ['" ' , '\\' ], true )) {
265
- throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a string contains invalid characters. " );
265
+ throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a String contains invalid characters. " );
266
266
}
267
267
268
268
$ returnValue .= $ char ;
269
269
}
270
270
271
- throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a string contains an invalid end string. " );
271
+ throw new SyntaxError ("The HTTP textual representation \"$ originalString \" for a String contains an invalid end string. " );
272
272
}
273
273
274
274
/**
0 commit comments