We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cee657 commit 601e640Copy full SHA for 601e640
src/RequestTrait.php
@@ -100,10 +100,10 @@ public function withRequestTarget($requestTarget): RequestInterface
100
return $this;
101
}
102
103
- if (is_string($requestTarget) && preg_match('/\s/', $requestTarget)) {
+ if (!is_string($requestTarget) || preg_match('/\s/', $requestTarget)) {
104
throw new InvalidArgumentException(sprintf(
105
- '`%s` is not valid request target. Request target cannot contain whitespace.',
106
- $requestTarget
+ '`%s` is not valid request target. Request target must be a string and cannot contain whitespace',
+ (is_object($requestTarget) ? get_class($requestTarget) : gettype($requestTarget))
107
));
108
109
0 commit comments