Skip to content

Commit fd95ee3

Browse files
authored
Merge pull request #10 from ByteInternet/composer_runtime_client_version
2 parents d98ab50 + 256a237 commit fd95ee3

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
}
2020
],
2121
"require": {
22+
"composer-runtime-api": "^2.0",
2223
"ext-curl": "*",
2324
"ext-json": "*",
2425
"nesbot/carbon": "^2.0",

src/HypernodeClient.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
class HypernodeClient
1717
{
18-
public const VERSION = '0.1.0';
19-
2018
public HttpMethodsClientInterface $api;
2119
public App $app;
2220
public BrancherApp $brancherApp;

src/HypernodeClientFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Hypernode\Api;
66

7+
use Composer\InstalledVersions;
78
use Http\Client\Common\HttpMethodsClient;
89
use Http\Client\Common\Plugin\AddHostPlugin;
910
use Http\Client\Common\Plugin\AddPathPlugin;
@@ -21,7 +22,10 @@ public static function create(string $authToken, ?ClientInterface $httpClient =
2122
{
2223
$httpHeaders = [
2324
'Authorization' => sprintf('Token %s', $authToken),
24-
'User-Agent' => sprintf('Hypernode API PHP Client v%s', HypernodeClient::VERSION),
25+
'User-Agent' => sprintf(
26+
'Hypernode API PHP Client v%s',
27+
InstalledVersions::getVersion('hypernode/api-client'),
28+
),
2529
'Accept' => 'application/json',
2630
'Content-Type' => 'application/json',
2731
];

0 commit comments

Comments
 (0)