Skip to content

Commit a66bf4a

Browse files
authored
Use version from a class for namespacing
Co-authored-by: Kevin Lot <klot@keyclic.com> related to #97
1 parent 8911a10 commit a66bf4a

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

lib/GetStream/Stream/Client.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
use DateTime;
55
use Exception;
66

7-
require_once('Version.php');
8-
97
class Client implements ClientInterface
108
{
119
const API_ENDPOINT = 'stream-io-api.com/api';

lib/GetStream/Stream/Constant.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace GetStream\Stream;
4+
5+
class Constant {
6+
const VERSION = '5.0.0';
7+
}

lib/GetStream/Stream/Feed.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
use GuzzleHttp\HandlerStack;
88
use GuzzleHttp\Psr7\Uri;
99

10-
require_once('Version.php');
11-
1210
class Feed extends BaseFeed implements FeedInterface
1311
{
1412
/**
@@ -66,7 +64,7 @@ protected function getHttpRequestHeaders($resource, $action)
6664
'Authorization' => $token,
6765
'Content-Type' => 'application/json',
6866
'stream-auth-type' => 'jwt',
69-
'X-Stream-Client' => 'stream-php-client-' . VERSION,
67+
'X-Stream-Client' => 'stream-php-client-' . Constant::VERSION,
7068
];
7169
}
7270

lib/GetStream/Stream/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function handlerStack($apiKey, $apiSecret, $resource)
2727
->withAddedHeader('Authorization', $token)
2828
->withAddedHeader('Stream-Auth-Type', 'jwt')
2929
->withAddedHeader('Content-Type', 'application/json')
30-
->withAddedHeader('X-Stream-Client', 'stream-php-client-' . VERSION);
30+
->withAddedHeader('X-Stream-Client', 'stream-php-client-' . Constant::VERSION);
3131
// Add a api_key query param.
3232
$queryParams = \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery());
3333
$query = http_build_query($queryParams + ['api_key' => $apiKey]);

lib/GetStream/Stream/Version.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)