Skip to content

Commit 632e2b5

Browse files
shyimflavioheleno
authored andcommitted
feat: php 8.4 support
1 parent 524a305 commit 632e2b5

11 files changed

Lines changed: 47 additions & 55 deletions

.github/workflows/continuous-integration.yml

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: "Continuous Integration"
33
on:
44
push:
55
paths-ignore:
6-
- 'doc/**'
7-
- '.github/**'
6+
- "doc/**"
7+
- ".github/**"
88
pull_request:
99
paths-ignore:
10-
- 'doc/**'
11-
- '.github/**'
10+
- "doc/**"
11+
- ".github/**"
1212

1313
jobs:
1414
phpunit:
@@ -21,53 +21,45 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
php-version:
24-
- '8.1'
25-
- '8.2'
26-
- '8.3'
24+
- "8.1"
25+
- "8.2"
26+
- "8.3"
27+
- "8.4"
2728
dependency-versions: [lowest, highest]
2829
experimental: [false]
29-
include:
30-
- php-version: '8.4'
31-
dependency-versions: lowest
32-
experimental: true
33-
composer-options: --ignore-platform-reqs
34-
- php-version: '8.4'
35-
dependency-versions: highest
36-
experimental: true
37-
composer-options: --ignore-platform-reqs
3830

3931
steps:
40-
- name: Repository checkout
41-
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
32+
- name: Repository checkout
33+
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
4234

43-
- name: Setup PHP with PECL extension
44-
uses: shivammathur/setup-php@efffd0e4f2504f936fcfe3b69293d31ce0e2fd7a # v2.30.3
45-
with:
46-
php-version: ${{ matrix.php-version }}
47-
tools: composer:v2
48-
coverage: pcov
35+
- name: Setup PHP with PECL extension
36+
uses: shivammathur/setup-php@efffd0e4f2504f936fcfe3b69293d31ce0e2fd7a # v2.30.3
37+
with:
38+
php-version: ${{ matrix.php-version }}
39+
tools: composer:v2
40+
coverage: pcov
4941

50-
- name: Validate composer.json and composer.lock
51-
run: composer validate --strict
42+
- name: Validate composer.json and composer.lock
43+
run: composer validate --strict
5244

53-
- name: Install dependencies
54-
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
55-
with:
56-
dependency-versions: ${{ matrix.dependency-versions }}
57-
composer-options: ${{ matrix.composer-options }}
45+
- name: Install dependencies
46+
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
47+
with:
48+
dependency-versions: ${{ matrix.dependency-versions }}
49+
composer-options: ${{ matrix.composer-options }}
5850

59-
- name: Pull the docker image used by the tests.
60-
run: docker pull busybox:latest
51+
- name: Pull the docker image used by the tests.
52+
run: docker pull busybox:latest
6153

62-
- name: Run PHPUnit test suite
63-
run: composer run-script test-ci
54+
- name: Run PHPUnit test suite
55+
run: composer run-script test-ci
6456

65-
- name: Publish code coverage
66-
uses: paambaati/codeclimate-action@a1831d7162ea1fbc612ffe5fb3b90278b7999d59 # v5.0.0
67-
env:
68-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
69-
with:
70-
coverageCommand: composer run-script test-coverage
71-
coverageLocations: |
72-
${{github.workspace}}/clover.xml:clover
73-
if: github.event_name != 'pull_request'
57+
- name: Publish code coverage
58+
uses: paambaati/codeclimate-action@a1831d7162ea1fbc612ffe5fb3b90278b7999d59 # v5.0.0
59+
env:
60+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
61+
with:
62+
coverageCommand: composer run-script test-coverage
63+
coverageLocations: |
64+
${{github.workspace}}/clover.xml:clover
65+
if: github.event_name != 'pull_request'

src/Context/Context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Context implements ContextInterface
5252
* @param string $format Format to use when sending the call (stream or tar: string)
5353
* @param Filesystem $fs filesystem object for cleaning the context directory on destruction
5454
*/
55-
public function __construct($directory, $format = self::FORMAT_STREAM, Filesystem $fs = null)
55+
public function __construct($directory, $format = self::FORMAT_STREAM, ?Filesystem $fs = null)
5656
{
5757
$this->directory = $directory;
5858
$this->format = $format;

src/Context/ContextBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ContextBuilder
4141
/**
4242
* @param \Symfony\Component\Filesystem\Filesystem $fs
4343
*/
44-
public function __construct(Filesystem $fs = null)
44+
public function __construct(?Filesystem $fs = null)
4545
{
4646
$this->fs = $fs ?: new Filesystem();
4747
$this->format = Context::FORMAT_STREAM;

src/Docker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function imageBuild($requestBody = null, array $queryParameters = [], arr
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
public function imageCreate(string $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
69+
public function imageCreate(?string $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT)
7070
{
7171
return $this->executeEndpoint(new ImageCreate($requestBody, $queryParameters, $headerParameters), $fetch);
7272
}

src/DockerClientFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
final class DockerClientFactory
1818
{
19-
public static function create(array $config = [], PluginClientFactory $pluginClientFactory = null): PluginClient
19+
public static function create(array $config = [], ?PluginClientFactory $pluginClientFactory = null): PluginClient
2020
{
2121
if (!\array_key_exists('remote_socket', $config)) {
2222
$config['remote_socket'] = 'unix:///var/run/docker.sock';
@@ -46,7 +46,7 @@ public static function create(array $config = [], PluginClientFactory $pluginCli
4646
);
4747
}
4848

49-
public static function createFromEnv(PluginClientFactory $pluginClientFactory = null): PluginClient
49+
public static function createFromEnv(?PluginClientFactory $pluginClientFactory = null): PluginClient
5050
{
5151
$options = [
5252
'remote_socket' => getenv('DOCKER_HOST') ? getenv('DOCKER_HOST') : 'unix:///var/run/docker.sock',

src/Endpoint/ContainerAttach.php

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

1212
class ContainerAttach extends BaseEndpoint
1313
{
14-
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null)
14+
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null)
1515
{
1616
if (200 === $response->getStatusCode() && DockerRawStream::HEADER === $contentType) {
1717
return new DockerRawStream($response->getBody());

src/Endpoint/ExecStart.php

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

1212
class ExecStart extends BaseEndpoint
1313
{
14-
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null)
14+
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null)
1515
{
1616
if (200 === $response->getStatusCode() && DockerRawStream::HEADER === $contentType) {
1717
return new DockerRawStream($response->getBody());

src/Endpoint/ImageBuild.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getBody(SerializerInterface $serializer, $streamFactory = null):
2424
return [['Content-Type' => ['application/octet-stream']], $body];
2525
}
2626

27-
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null)
27+
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null)
2828
{
2929
if (200 === $response->getStatusCode()) {
3030
return new BuildStream($response->getBody(), $serializer);

src/Endpoint/ImageCreate.php

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

1212
class ImageCreate extends BaseEndpoint
1313
{
14-
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null)
14+
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null)
1515
{
1616
if (200 === $response->getStatusCode()) {
1717
return new CreateImageStream($response->getBody(), $serializer);

src/Endpoint/ImagePush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function getUri(): string
1616
return str_replace(['{name}'], [urlencode($this->name)], '/images/{name}/push');
1717
}
1818

19-
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, string $contentType = null)
19+
protected function transformResponseBody(ResponseInterface $response, SerializerInterface $serializer, ?string $contentType = null)
2020
{
2121
if (200 === $response->getStatusCode()) {
2222
return new PushStream($response->getBody(), $serializer);

0 commit comments

Comments
 (0)