Skip to content

Commit 188f89f

Browse files
Use null default convention
1 parent bf0835c commit 188f89f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ public function flushHeaders()
9696
* Add an authorization token for the request.
9797
*
9898
* @param string $token
99-
* @param string $type
99+
* @param string|null $type
100100
* @return $this
101101
*/
102-
public function withToken(string $token, string $type = 'Bearer')
102+
public function withToken(string $token, string $type = null)
103103
{
104-
$this->defaultHeaders['Authorization'] = trim($type.' '.$token);
104+
$this->defaultHeaders['Authorization'] = sprintf('%s %s', $type ?? 'Bearer', $token);
105105

106106
return $this;
107107
}

0 commit comments

Comments
 (0)