Skip to content

Commit 0282809

Browse files
Merge branch 'master' into release_v3
2 parents 995d44c + 7bb9078 commit 0282809

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Bolt.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,4 @@ private function packProtocolVersions(): string
179179

180180
return implode('', $versions);
181181
}
182-
183182
}

src/helpers/Auth.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ class Auth
1515
/**
1616
* @var string
1717
*/
18-
public static $userAgent = 'bolt-php';
18+
public static $defaultUserAgent = 'bolt-php';
1919

2020
/**
2121
* None authorization
2222
* @return array
2323
*/
24-
public static function none(): array
24+
public static function none(?string $userAgent = null): array
2525
{
2626
return [
27-
'user_agent' => self::$userAgent,
27+
'user_agent' => $userAgent ?? self::$defaultUserAgent,
2828
'scheme' => 'none'
2929
];
3030
}
@@ -35,10 +35,10 @@ public static function none(): array
3535
* @param string $password
3636
* @return array
3737
*/
38-
public static function basic(string $username, string $password): array
38+
public static function basic(string $username, string $password, ?string $userAgent = null): array
3939
{
4040
return [
41-
'user_agent' => self::$userAgent,
41+
'user_agent' => $userAgent ?? self::$defaultUserAgent,
4242
'scheme' => 'basic',
4343
'principal' => $username,
4444
'credentials' => $password
@@ -50,10 +50,10 @@ public static function basic(string $username, string $password): array
5050
* @param string $token
5151
* @return array
5252
*/
53-
public static function bearer(string $token): array
53+
public static function bearer(string $token, ?string $userAgent = null): array
5454
{
5555
return [
56-
'user_agent' => self::$userAgent,
56+
'user_agent' => $userAgent ?? self::$defaultUserAgent,
5757
'scheme' => 'bearer',
5858
'credentials' => $token
5959
];

0 commit comments

Comments
 (0)