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 bf0835c commit 188f89fCopy full SHA for 188f89f
src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
@@ -96,12 +96,12 @@ public function flushHeaders()
96
* Add an authorization token for the request.
97
*
98
* @param string $token
99
- * @param string $type
+ * @param string|null $type
100
* @return $this
101
*/
102
- public function withToken(string $token, string $type = 'Bearer')
+ public function withToken(string $token, string $type = null)
103
{
104
- $this->defaultHeaders['Authorization'] = trim($type.' '.$token);
+ $this->defaultHeaders['Authorization'] = sprintf('%s %s', $type ?? 'Bearer', $token);
105
106
return $this;
107
}
0 commit comments