Skip to content

Commit 4d184a4

Browse files
Fixed grammar errors (#121)
1 parent d8b0079 commit 4d184a4

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class Http implements Stringable, Psr7UriInterface, JsonSerializable
2929
private function __construct(private readonly UriInterface $uri)
3030
{
3131
if (null === $this->uri->getScheme() && '' === $this->uri->getHost()) {
32-
throw new SyntaxError('An URI without scheme can not contains a empty host string according to PSR-7: '.$uri);
32+
throw new SyntaxError('An URI without scheme cannot contain an empty host string according to PSR-7: '.$uri);
3333
}
3434

3535
$port = $this->uri->getPort();

Uri.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ private function formatHost(?string $host): ?string
300300
*
301301
* @throws MissingFeature if the submitted host required missing or misconfigured IDN support
302302
* @throws SyntaxError if the submitted host is not a valid registered name
303-
* @throws ConversionFailed if the submitted IDN host can not be converted to a valid ascii form
303+
* @throws ConversionFailed if the submitted IDN host cannot be converted to a valid ascii form
304304
*/
305305
private function formatRegisteredName(string $host): string
306306
{
307307
$formattedHost = rawurldecode($host);
308308

309309
return match (1) {
310310
preg_match(self::REGEXP_HOST_REGNAME, $formattedHost) => $formattedHost,
311-
preg_match(self::REGEXP_HOST_GEN_DELIMS, $formattedHost) => throw new SyntaxError('The host `'.$host.'` is invalid : a registered name can not contain URI delimiters or spaces.'),
311+
preg_match(self::REGEXP_HOST_GEN_DELIMS, $formattedHost) => throw new SyntaxError('The host `'.$host.'` is invalid : a registered name cannot contain URI delimiters or spaces.'),
312312
default => IdnConverter::toAsciiOrFail($host),
313313
};
314314
}
@@ -428,7 +428,7 @@ public static function fromBaseUri(Stringable|string $uri, Stringable|string|nul
428428
* Creates a new instance from a template.
429429
*
430430
* @throws TemplateCanNotBeExpanded if the variables are invalid or missing
431-
* @throws UriException if the resulting expansion can not be converted to a UriInterface instance
431+
* @throws UriException if the resulting expansion cannot be converted to a UriInterface instance
432432
*/
433433
public static function fromTemplate(UriTemplate|Stringable|string $template, iterable $variables = []): self
434434
{
@@ -604,7 +604,7 @@ private static function fetchUserInfo(array $server): array
604604
/**
605605
* Returns the environment host.
606606
*
607-
* @throws SyntaxError If the host can not be detected
607+
* @throws SyntaxError If the host cannot be detected
608608
*
609609
* @return array{0:string|null, 1:int|null}
610610
*/
@@ -800,7 +800,7 @@ private function assertValidState(): void
800800
}
801801

802802
if (null === $this->authority && str_starts_with($this->path, '//')) {
803-
throw new SyntaxError('If there is no authority the path `'.$this->path.'` can not start with a `//`.');
803+
throw new SyntaxError('If there is no authority the path `'.$this->path.'` cannot start with a `//`.');
804804
}
805805

806806
$pos = strpos($this->path, ':');
@@ -1041,7 +1041,7 @@ public function withScheme(Stringable|string|null $scheme): UriInterface
10411041
/**
10421042
* Filter a string.
10431043
*
1044-
* @throws SyntaxError if the submitted data can not be converted to string
1044+
* @throws SyntaxError if the submitted data cannot be converted to string
10451045
*/
10461046
private function filterString(Stringable|string|null $str): ?string
10471047
{
@@ -1119,7 +1119,7 @@ public function withPath(Stringable|string $path): UriInterface
11191119
{
11201120
$path = $this->filterString($path);
11211121
if (null === $path) {
1122-
throw new SyntaxError('The path component can not be null.');
1122+
throw new SyntaxError('The path component cannot be null.');
11231123
}
11241124
$path = $this->formatPath($path);
11251125
if ($path === $this->path) {

UriTemplate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function withDefaultVariables(iterable $defaultVariables): self
100100

101101
/**
102102
* @throws TemplateCanNotBeExpanded if the variables are invalid
103-
* @throws UriException if the resulting expansion can not be converted to a UriInterface instance
103+
* @throws UriException if the resulting expansion cannot be converted to a UriInterface instance
104104
*/
105105
public function expand(iterable $variables = []): UriInterface
106106
{
@@ -111,7 +111,7 @@ public function expand(iterable $variables = []): UriInterface
111111

112112
/**
113113
* @throws TemplateCanNotBeExpanded if the variables are invalid or missing
114-
* @throws UriException if the resulting expansion can not be converted to a UriInterface instance
114+
* @throws UriException if the resulting expansion cannot be converted to a UriInterface instance
115115
*/
116116
public function expandOrFail(iterable $variables = []): UriInterface
117117
{

UriTemplate/ExpressionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public function testExpandThrowsExceptionIfTheModifierCanNotBeApplied(string $ex
244244
public static function invalidModifierToApply(): iterable
245245
{
246246
return [
247-
'can not apply a modifier on a hash value (1)' => [
247+
'cannot apply a modifier on a hash value (1)' => [
248248
'expression' => '{keys:1}',
249249
'variables' => [
250250
'keys' => [
@@ -254,7 +254,7 @@ public static function invalidModifierToApply(): iterable
254254
],
255255
],
256256
],
257-
'can not apply a modifier on a hash value (2)' => [
257+
'cannot apply a modifier on a hash value (2)' => [
258258
'expression' => '{+keys:1}',
259259
'variables' => [
260260
'keys' => [

UriTemplate/TemplateCanNotBeExpanded.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function __construct(string $message = '', string ...$variableNames)
2929

3030
public static function dueToUnableToProcessValueListWithPrefix(string $variableName): self
3131
{
32-
return new self('The ":" modifier can not be applied on "'.$variableName.'" since it is a list of values.', $variableName);
32+
return new self('The ":" modifier cannot be applied on "'.$variableName.'" since it is a list of values.', $variableName);
3333
}
3434

3535
public static function dueToNestedListOfValue(string $variableName): self
3636
{
37-
return new self('The "'.$variableName.'" can not be a nested list.', $variableName);
37+
return new self('The "'.$variableName.'" cannot be a nested list.', $variableName);
3838
}
3939

4040
public static function dueToMissingVariables(string ...$variableNames): self

0 commit comments

Comments
 (0)