You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is_string($reason) => ForwardedReason::tryFromToken(Token::tryFromString($reason)) ?? thrownewInvalidSyntax('`'.$reason.'` is an invalid forward reason.'),
38
-
$reasoninstanceof Token => ForwardedReason::tryFromToken($reason) ?? thrownewInvalidSyntax('`'.$reason->toString().'` is an invalid forward reason.'),
37
+
is_string($reason) => ForwardedReason::tryFromToken(Token::tryFromString($reason)) ?? thrownewInvalidSyntaxException('`'.$reason.'` is an invalid forward reason.'),
38
+
$reasoninstanceof Token => ForwardedReason::tryFromToken($reason) ?? thrownewInvalidSyntaxException('`'.$reason->toString().'` is an invalid forward reason.'),
Copy file name to clipboardExpand all lines: src/HandledRequestCache.php
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,12 @@ private function __construct(
30
30
publicToken|string|null$detail,
31
31
) {
32
32
match (true) {
33
-
!Type::Token->supports($this->servedBy) && !Type::String->supports($this->servedBy) => thrownewInvalidSyntax('The handled request cache identifier must be a Token or a string.'),
34
-
null !== $this->forward && $this->hit => thrownewInvalidSyntax('The handled request cache can not be both a hit and forwarded.'),
35
-
null === $this->forward && !$this->hit => thrownewInvalidSyntax('The handled request cache must be a hit or forwarded.'),
36
-
null !== $this->key && !Type::String->supports($this->key) => thrownewInvalidSyntax('The `key` parameter must be a string or null.'),
37
-
null !== $this->ttl && !Type::Integer->supports($this->ttl) => thrownewInvalidSyntax('The `ttl` parameter must be a integer or null.'),
38
-
null !== $this->detail && !Type::String->supports($this->detail) && !Type::Token->supports($this->detail) => thrownewInvalidSyntax('The `detail` parameter must be a string or a Token when present.'),
33
+
!Type::Token->supports($this->servedBy) && !Type::String->supports($this->servedBy) => thrownewInvalidSyntaxException('The handled request cache identifier must be a Token or a string.'),
34
+
null !== $this->forward && $this->hit => thrownewInvalidSyntaxException('The handled request cache can not be both a hit and forwarded.'),
35
+
null === $this->forward && !$this->hit => thrownewInvalidSyntaxException('The handled request cache must be a hit or forwarded.'),
36
+
null !== $this->key && !Type::String->supports($this->key) => thrownewInvalidSyntaxException('The `key` parameter must be a string or null.'),
37
+
null !== $this->ttl && !Type::Integer->supports($this->ttl) => thrownewInvalidSyntaxException('The `ttl` parameter must be a integer or null.'),
38
+
null !== $this->detail && !Type::String->supports($this->detail) && !Type::Token->supports($this->detail) => thrownewInvalidSyntaxException('The `detail` parameter must be a string or a Token when present.'),
39
39
default => null,
40
40
};
41
41
}
@@ -54,7 +54,7 @@ public static function serverIdentifierAsString(string $identifier): self
is_string($forward) => Forward::fromReason(ForwardedReason::tryFrom($forward) ?? thrownewInvalidSyntax('The submitted string is not a valid server identifier.')),
190
+
is_string($forward) => Forward::fromReason(ForwardedReason::tryFrom($forward) ?? thrownewInvalidSyntaxException('The submitted string is not a valid server identifier.')),
0 commit comments