Skip to content

Commit 23d0915

Browse files
authored
Merge pull request #68 from kochen/php_84_85
test with newer php versions
2 parents 8ae4e60 + f25d563 commit 23d0915

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
php-version: ["8.2", "8.3"]
39+
php-version: ["8.2", "8.3", "8.4", "8.5"]
4040
composer-flags: [""]
4141
name: [""]
4242
include:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"require": {
1414
"php": ">=8.1",
1515
"psr/log": "^1|^2|^3",
16-
"symfony/http-client": "^5.4|^6.4|^7.0"
16+
"symfony/http-client": "^5.4|^6.4|^7.0|^8.0"
1717
},
1818
"require-dev": {
19-
"symfony/phpunit-bridge": "^6.0|^7.0"
19+
"symfony/phpunit-bridge": "^6.0|^7.0|^8.0"
2020
},
2121
"autoload": {
2222
"psr-4": {

src/Client.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@ private function doRequest(string $method, string $url, array $options): ConsulR
6868
$options['body'] = json_encode($options['body'], \JSON_THROW_ON_ERROR);
6969
}
7070

71-
$this->logger->info(sprintf('%s "%s"', $method, $url));
72-
$this->logger->debug(sprintf('Requesting %s %s', $method, $url), ['options' => $options]);
71+
$this->logger->info(\sprintf('%s "%s"', $method, $url));
72+
$this->logger->debug(\sprintf('Requesting %s %s', $method, $url), ['options' => $options]);
7373

7474
try {
7575
$response = $this->client->request($method, $url, $options);
7676
} catch (TransportExceptionInterface $e) {
77-
$message = sprintf('Something went wrong when calling consul (%s).', $e->getMessage());
77+
$message = \sprintf('Something went wrong when calling consul (%s).', $e->getMessage());
7878

7979
$this->logger->error($message);
8080

8181
throw new ServerException($message);
8282
}
8383

84-
$this->logger->debug(sprintf("Response:\n%s", $this->formatResponse($response)));
84+
$this->logger->debug(\sprintf("Response:\n%s", $this->formatResponse($response)));
8585

8686
if (400 <= $response->getStatusCode()) {
87-
$message = sprintf('Something went wrong when calling consul (%s).', $response->getStatusCode());
87+
$message = \sprintf('Something went wrong when calling consul (%s).', $response->getStatusCode());
8888

8989
$this->logger->error($message);
9090

@@ -105,10 +105,10 @@ private function formatResponse(ResponseInterface $response): string
105105

106106
foreach ($response->getHeaders(false) as $key => $values) {
107107
foreach ($values as $value) {
108-
$headers[] = sprintf('%s: %s', $key, $value);
108+
$headers[] = \sprintf('%s: %s', $key, $value);
109109
}
110110
}
111111

112-
return sprintf("%s\n\n%s", implode("\n", $headers), $response->getContent(false));
112+
return \sprintf("%s\n\n%s", implode("\n", $headers), $response->getContent(false));
113113
}
114114
}

tests/DsnResolverTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77

88
class DsnResolverTest extends TestCase
99
{
10-
public function provideResolveTest(): iterable
11-
{
12-
yield ['http://127.0.0.1:5000', 'http://127.0.0.1:5000'];
13-
yield ['https://127.0.0.1:5000', 'https://127.0.0.1:5000'];
14-
yield ['https://foo:5000', 'https://foo:5000'];
15-
yield ['http://127.0.0.1:5000', '127.0.0.1:5000'];
16-
yield ['http://127.0.0.1:5000', '127.0.0.1:5000'];
17-
yield ['http://127.0.0.1:8500', null];
18-
}
19-
2010
/** @dataProvider provideResolveTest */
2111
public function testResolve(string $expected, ?string $dsn)
2212
{
@@ -32,4 +22,14 @@ public function testResolve(string $expected, ?string $dsn)
3222
}
3323
}
3424
}
25+
26+
public function provideResolveTest(): iterable
27+
{
28+
yield ['http://127.0.0.1:5000', 'http://127.0.0.1:5000'];
29+
yield ['https://127.0.0.1:5000', 'https://127.0.0.1:5000'];
30+
yield ['https://foo:5000', 'https://foo:5000'];
31+
yield ['http://127.0.0.1:5000', '127.0.0.1:5000'];
32+
yield ['http://127.0.0.1:5000', '127.0.0.1:5000'];
33+
yield ['http://127.0.0.1:8500', null];
34+
}
3535
}

0 commit comments

Comments
 (0)