Skip to content

Commit 03d76d7

Browse files
committed
Test against PHP 8.4.0RC3
1 parent d08d2f8 commit 03d76d7

File tree

8 files changed

+63
-32
lines changed

8 files changed

+63
-32
lines changed

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ insert_final_newline = true
88
indent_style = space
99
indent_size = 4
1010

11-
[{*.yaml,*yml,*.neon}]
11+
[{*.yaml,*.yml,*.neon,*.json}]
1212
indent_size = 2
1313

14-
[Makefile]
14+
[*.md]
15+
max_line_length = 100
16+
17+
[{Dockerfile,Makefile}]
1518
indent_style = tab

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
php-version:
1414
- "8.2"
1515
- "8.3"
16+
- "8.4"
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@v4

Dockerfile

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
1-
ARG PHP_VERSION
1+
ARG PHP_VERSION=8.2
22
FROM php:${PHP_VERSION}-cli-bookworm
33

4-
RUN apt-get update && \
5-
apt-get install -y autoconf pkg-config && \
6-
pecl channel-update pecl.php.net && \
7-
pecl install xdebug &&\
8-
docker-php-ext-enable opcache xdebug
4+
RUN <<-EOF
5+
docker-php-ext-enable opcache
96

10-
RUN echo '\
11-
xdebug.client_host=host.docker.internal\n\
12-
xdebug.mode=develop\n\
13-
xdebug.start_with_request=yes\n\
14-
' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
7+
if [ "$PHP_VERSION" \< "8.4" ]; then
8+
apt-get update
9+
apt-get install -y autoconf pkg-config
10+
pecl channel-update pecl.php.net
11+
pecl install xdebug
12+
docker-php-ext-enable xdebug
13+
fi
14+
EOF
1515

16-
RUN echo '\
17-
display_errors=On\n\
18-
error_reporting=E_ALL\n\
19-
date.timezone=UTC\n\
20-
' >> /usr/local/etc/php/conf.d/php.ini
16+
RUN <<-EOF
17+
cat <<-SHELL >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
18+
xdebug.client_host=host.docker.internal
19+
xdebug.mode=develop
20+
xdebug.start_with_request=yes
21+
SHELL
22+
23+
cat <<-SHELL >> /usr/local/etc/php/conf.d/php.ini
24+
display_errors=On
25+
error_reporting=E_ALL
26+
date.timezone=UTC
27+
SHELL
28+
EOF
2129

2230
ENV COMPOSER_ALLOW_SUPERUSER 1
2331

24-
RUN apt-get update && \
25-
apt-get install unzip && \
26-
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \
27-
mv composer.phar /usr/local/bin/composer && \
28-
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"\n' >> /root/.bashrc
32+
RUN <<-EOF
33+
apt-get update
34+
apt-get install unzip
35+
curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet
36+
mv composer.phar /usr/local/bin/composer
37+
cat <<-SHELL >> /root/.bashrc
38+
export PATH="$HOME/.composer/vendor/bin:$PATH"
39+
SHELL
40+
EOF
2941

3042
RUN composer global require squizlabs/php_codesniffer
3143

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test-dependencies: vendor test-cleanup
88

99
.PHONY: test
1010
test: test-dependencies
11-
@$(PHPUNIT)
11+
@$(PHPUNIT) $(ARGS)
1212

1313
.PHONY: test-coverage
1414
test-coverage: test-dependencies
@@ -37,6 +37,11 @@ test-container-83:
3737
@-docker-compose run --rm app83 bash
3838
@docker-compose down -v
3939

40+
.PHONY: test-container-84
41+
test-container-84:
42+
@-docker-compose run --rm app84 bash
43+
@docker-compose down -v
44+
4045
.PHONY: lint
4146
lint:
4247
@XDEBUG_MODE=off phpcs -s

docker-compose.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
version: "3.2"
32
services:
43
app82:
54
build:
@@ -9,8 +8,8 @@ services:
98
environment:
109
PHP_IDE_CONFIG: "serverName=symfony-di-proxy"
1110
volumes:
12-
- .:/app:delegated
13-
- ~/.composer:/root/.composer:delegated
11+
- .:/app:delegated
12+
- ~/.composer:/root/.composer:delegated
1413
app83:
1514
build:
1615
context: .
@@ -19,5 +18,15 @@ services:
1918
environment:
2019
PHP_IDE_CONFIG: "serverName=symfony-di-proxy"
2120
volumes:
22-
- .:/app:delegated
23-
- ~/.composer:/root/.composer:delegated
21+
- .:/app:delegated
22+
- ~/.composer:/root/.composer:delegated
23+
app84:
24+
build:
25+
context: .
26+
args:
27+
PHP_VERSION: "8.4.0RC3"
28+
environment:
29+
PHP_IDE_CONFIG: "serverName=symfony-di-proxy"
30+
volumes:
31+
- .:/app:delegated
32+
- ~/.composer:/root/.composer:delegated

lib/ProxyDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
/**
3535
* @inheritdoc
3636
*/
37-
public function isProxyCandidate(Definition $definition, bool &$asGhostObject = null, string $id = null): bool
37+
public function isProxyCandidate(Definition $definition, ?bool &$asGhostObject = null, ?string $id = null): bool
3838
{
3939
$class = $definition->getClass();
4040

@@ -76,7 +76,7 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
7676
/**
7777
* @inheritdoc
7878
*/
79-
public function getProxyCode(Definition $definition, string $id = null): string
79+
public function getProxyCode(Definition $definition, ?string $id = null): string
8080
{
8181
return '';
8282
}

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
colors="true"
55
bootstrap="tests/bootstrap.php"
6+
displayDetailsOnTestsThatTriggerDeprecations="true"
67
>
78
<testsuites>
89
<testsuite name="olvlvl/symfony-dependency-injection-proxy">

tests/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class IntegrationTest extends TestCase
3939
*
4040
* @param Definition[] $definitions
4141
*/
42-
public function testCompilation(array $definitions, callable $assert, callable $tweakBuilder = null): void
42+
public function testCompilation(array $definitions, callable $assert, ?callable $tweakBuilder = null): void
4343
{
4444
$builder = new ContainerBuilder();
4545
$builder->addDefinitions($definitions);

0 commit comments

Comments
 (0)