Skip to content

Commit e97f76d

Browse files
committed
Updated user agent
1 parent f906f7e commit e97f76d

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

src/Http/BaseClient.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ abstract class BaseClient {
3939
*/
4040
const AUTH_HEADER = 'X-API-KEY';
4141

42-
/**
43-
* The client user agent
44-
* @var string
45-
*/
46-
const USER_AGENT = 'MegaOptim PHP Client';
47-
4842
/**
4943
* Optimize
5044
* @url https://api.megaoptim.com/v1/optimize
@@ -67,7 +61,7 @@ abstract class BaseClient {
6761
* Additional user agent info
6862
* @var string
6963
*/
70-
private static $user_agent = null;
64+
public static $user_agent = 'MegaOptim PHP Client';
7165

7266
/**
7367
* The MegaOptim api key that is used to authenticate the request
@@ -183,12 +177,7 @@ public static function to_curl_file( $resource ) {
183177
* @return string
184178
*/
185179
public static function get_user_agent() {
186-
$user_agent = self::USER_AGENT . ' v' . Optimizer::VERSION;
187-
if ( ! is_null( self::$user_agent ) && ! empty( self::$user_agent ) ) {
188-
$user_agent = $user_agent . ', ' . self::$user_agent;
189-
}
190-
191-
return $user_agent;
180+
return self::$user_agent;
192181
}
193182

194183

0 commit comments

Comments
 (0)