Skip to content

Commit 8ae4e60

Browse files
authored
Merge pull request #64 from FriendsOfPHP/up
Drop support for PHP < .8.0 + Add support for PHP 8.2, and 8.3
2 parents 366e4c4 + 0d2b764 commit 8ae4e60

File tree

16 files changed

+28
-27
lines changed

16 files changed

+28
-27
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
7-
schedule:
8-
- cron: "0 0 * * MON"
97

108
jobs:
119
php-cs-fixer:
@@ -38,17 +36,17 @@ jobs:
3836
strategy:
3937
fail-fast: false
4038
matrix:
41-
php-version: ["7.4", "8.0", "8.1"]
39+
php-version: ["8.2", "8.3"]
4240
composer-flags: [""]
4341
name: [""]
4442
include:
45-
- php-version: 7.4
43+
- php-version: 8.1
4644
composer-flags: "--prefer-lowest"
4745
name: "(prefer lowest dependencies)"
4846

4947
services:
5048
service-name-1:
51-
image: consul
49+
image: consul:1.15
5250
ports:
5351
- 8500:8500
5452

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
return (new PhpCsFixer\Config())
1111
->setRiskyAllowed(true)
1212
->setRules([
13-
'@PHP74Migration' => true,
13+
'@PHP81Migration' => true,
1414
'@PhpCsFixer' => true,
1515
'@Symfony' => true,
1616
'@Symfony:risky' => true,

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# CHANGELOG
22

3-
## 5.2.0 (not released yet)
3+
## 5.3.0 (not released yet)
4+
5+
## 5.2.0 (2024-03-04)
6+
7+
* Drop support for PHP < .8.0
8+
* Add support for PHP 8.2, and 8.3
9+
* Drop support for Symfony < 5.4, and 6.0, 6.1, 6.2, and 6.3
410

511
## 5.1.0 (2023-12-21)
612

composer.json

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

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class Client implements ClientInterface
1616
private HttpClientInterface $client;
1717
private LoggerInterface $logger;
1818

19-
public function __construct(array $options = [], LoggerInterface $logger = null, HttpClientInterface $client = null)
19+
public function __construct(array $options = [], ?LoggerInterface $logger = null, ?HttpClientInterface $client = null)
2020
{
2121
if (!$client) {
2222
$options['base_uri'] = DsnResolver::resolve($options);
@@ -27,7 +27,7 @@ public function __construct(array $options = [], LoggerInterface $logger = null,
2727
$this->logger = $logger ?? new NullLogger();
2828
}
2929

30-
public function get(string $url = null, array $options = []): ConsulResponse
30+
public function get(?string $url = null, array $options = []): ConsulResponse
3131
{
3232
return $this->doRequest('GET', $url, $options);
3333
}

src/ClientInterface.php

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

55
interface ClientInterface
66
{
7-
public function get(string $url = null, array $options = []): ConsulResponse;
7+
public function get(?string $url = null, array $options = []): ConsulResponse;
88

99
public function head(string $url, array $options = []): ConsulResponse;
1010

src/Helper/LockHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class LockHandler
1414

1515
private $sessionId;
1616

17-
public function __construct($key, $value = null, Session $session = null, KV $kv = null)
17+
public function __construct($key, $value = null, ?Session $session = null, ?KV $kv = null)
1818
{
1919
$this->key = $key;
2020
$this->value = $value;

src/Helper/MultiLockHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Consul\Services\KV;
66
use Consul\Services\Session;
7-
use Exception;
87

98
class MultiLockHandler
109
{
@@ -45,7 +44,7 @@ public function lock(): bool
4544

4645
$lockedResources[] = $resource;
4746
}
48-
} catch (Exception $e) {
47+
} catch (\Exception $e) {
4948
$result = false;
5049
} finally {
5150
if (!$result) {

src/Helper/MultiSemaphore.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Consul\Helper\MultiSemaphore\Resource;
66
use Consul\Services\KV;
77
use Consul\Services\Session;
8-
use RuntimeException;
98

109
class MultiSemaphore
1110
{
@@ -34,7 +33,7 @@ public function getResources(): array
3433
public function acquire(): bool
3534
{
3635
if (null !== $this->sessionId) {
37-
throw new RuntimeException('Resources are acquired already');
36+
throw new \RuntimeException('Resources are acquired already');
3837
}
3938

4039
// Start a session

src/Services/Agent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class Agent
1111
{
1212
private ClientInterface $client;
1313

14-
public function __construct(ClientInterface $client = null)
14+
public function __construct(?ClientInterface $client = null)
1515
{
1616
$this->client = $client ?: new Client();
1717
}

0 commit comments

Comments
 (0)