Skip to content

Commit 8a2a1ba

Browse files
committed
renamed userAgent to defaultUserAgent
1 parent 13827ed commit 8a2a1ba

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/Bolt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private function packProtocolVersions(): string
207207
public function init($userAgentOrExtra, string $user = '', string $password = '', $routing = false, array &$metadata = []): bool
208208
{
209209
if (is_string($userAgentOrExtra)) {
210-
Auth::$userAgent = $userAgentOrExtra;
210+
Auth::$defaultUserAgent = $userAgentOrExtra;
211211
$userAgentOrExtra = empty($user) && empty($password) ? Auth::none() : Auth::basic($user, $password);
212212
if ($routing !== false)
213213
$userAgentOrExtra['routing'] = $routing;

src/helpers/Auth.php

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

2020
/**
2121
* None authorization
@@ -24,7 +24,7 @@ class Auth
2424
public static function none(): array
2525
{
2626
return [
27-
'user_agent' => self::$userAgent,
27+
'user_agent' => self::$defaultUserAgent,
2828
'scheme' => 'none'
2929
];
3030
}
@@ -38,7 +38,7 @@ public static function none(): array
3838
public static function basic(string $username, string $password): array
3939
{
4040
return [
41-
'user_agent' => self::$userAgent,
41+
'user_agent' => self::$defaultUserAgent,
4242
'scheme' => 'basic',
4343
'principal' => $username,
4444
'credentials' => $password
@@ -53,7 +53,7 @@ public static function basic(string $username, string $password): array
5353
public static function bearer(string $token): array
5454
{
5555
return [
56-
'user_agent' => self::$userAgent,
56+
'user_agent' => self::$defaultUserAgent,
5757
'scheme' => 'bearer',
5858
'credentials' => $token
5959
];

tests/protocol/V1Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class V1Test extends \Bolt\tests\ATest
2727
*/
2828
public function test__construct()
2929
{
30-
\Bolt\helpers\Auth::$userAgent = 'Test/1.0';
30+
\Bolt\helpers\Auth::$defaultUserAgent = 'Test/1.0';
3131
$cls = new V1(new \Bolt\PackStream\v1\Packer, new \Bolt\PackStream\v1\Unpacker, $this->mockConnection());
3232
$this->assertInstanceOf(V1::class, $cls);
3333
return $cls;

tests/protocol/V4_1Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class V4_1Test extends \Bolt\tests\ATest
2424
*/
2525
public function test__construct()
2626
{
27-
\Bolt\helpers\Auth::$userAgent = 'Test/1.0';
27+
\Bolt\helpers\Auth::$defaultUserAgent = 'Test/1.0';
2828
$cls = new V4_1(new \Bolt\PackStream\v1\Packer, new \Bolt\PackStream\v1\Unpacker, $this->mockConnection());
2929
$this->assertInstanceOf(V4_1::class, $cls);
3030
return $cls;

0 commit comments

Comments
 (0)