Skip to content

Commit a38d45a

Browse files
feat: add processor as Closure
1 parent 9fb9a2b commit a38d45a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+867
-88
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php-version: ['8.1', '8.2', '8.3']
14+
php-version: ['8.1', '8.2', '8.3', '8.5']
1515
symfony-version: ['5.4.*', '6.4.*', '7.0.*']
1616
doctrine-orm-version: ['2.14.*', '2.15.*', '2.16.*', '2.17.*', '3.0.*']
1717
exclude:
@@ -50,8 +50,13 @@ jobs:
5050
- name: Run PHP-CS-Fixer
5151
run: vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --using-cache=no
5252

53-
- name: Run PHPStan
54-
run: vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=1G
53+
- name: Run PHPStan (PHP < 8.5)
54+
if: matrix.php-version != '8.5'
55+
run: vendor/bin/phpstan analyse src tests --configuration=phpstan-lt-8.5.neon --memory-limit=1G
56+
57+
- name: Run PHPStan (PHP 8.5+)
58+
if: matrix.php-version == '8.5'
59+
run: vendor/bin/phpstan analyse src tests --configuration=phpstan-8.5-plus.neon --memory-limit=1G
5560

5661
- name: Run PHPUnit tests
5762
run: vendor/bin/phpunit --testsuite unit --testsuite functional

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ composer.lock
1111
!bin/console
1212
!bin/symfony_requirements
1313
/vendor/
14+
/vendor85/
1415
/phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@
2424
$config = new PhpCsFixer\Config();
2525
$config->setUsingCache(false);
2626
$config->setRiskyAllowed(true);
27+
$config->setUnsupportedPhpVersionAllowed(true);
2728
$config->setRules($additionalRules);
2829

2930
$finder = (new PhpCsFixer\Finder())
3031
->in(__DIR__)
3132
->exclude('var')
33+
->exclude('vendor')
34+
->exclude('vendor85')
3235
;
3336

3437
$config->setFinder($finder);

Makefile

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
1-
.PHONY: setup php cs-fixer phpstan tests
1+
.PHONY: setup setup-php81 setup-php85 php php81 php85 cs-fixer cs-fixer-php81 cs-fixer-php85 phpstan phpstan-php81 phpstan-php85 tests tests-php81 tests-php85
22

3-
setup:
4-
docker-compose up --build -d
5-
docker-compose exec php composer install
3+
setup: setup-php81 setup-php85
64

7-
php:
8-
docker-compose exec php sh
5+
setup-php81:
6+
rm -f composer.lock
7+
docker-compose up --build -d php81
8+
docker-compose exec php81 composer install
99

10-
cs-fixer:
11-
docker-compose exec php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes
10+
setup-php85:
11+
rm -f composer.lock
12+
docker-compose up --build -d php85
13+
docker-compose exec php85 sh -c "COMPOSER_VENDOR_DIR=vendor85 composer install"
1214

13-
phpstan:
14-
docker-compose exec php vendor/bin/phpstan analyse src tests --configuration=phpstan.neon --memory-limit=1G
15+
php: php81
1516

16-
tests:
17+
php81:
18+
docker-compose exec php81 sh
19+
20+
php85:
21+
docker-compose exec php85 sh
22+
23+
cs-fixer: cs-fixer-php81 cs-fixer-php85
24+
25+
cs-fixer-php81:
26+
docker-compose exec php81 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes
27+
28+
cs-fixer-php85:
29+
docker-compose exec php85 vendor85/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes
30+
31+
phpstan: phpstan-php81 phpstan-php85
32+
33+
phpstan-php81:
34+
docker-compose exec php81 vendor/bin/phpstan analyse src tests --configuration=phpstan-lt-8.5.neon --memory-limit=1G
35+
36+
phpstan-php85:
37+
docker-compose exec php85 sh -c "mv vendor vendor_tmp && COMPOSER_VENDOR_DIR=vendor85 vendor85/bin/phpstan analyse src tests --configuration=phpstan-8.5-plus.neon --memory-limit=1G; mv vendor_tmp vendor"
38+
39+
tests: tests-php81 tests-php85
40+
41+
tests-php81:
42+
rm -rf var/cache/test
43+
mkdir -p var/cache/test
44+
docker-compose exec php81 vendor/bin/phpunit
45+
46+
tests-php85:
1747
rm -rf var/cache/test
1848
mkdir -p var/cache/test
19-
docker-compose exec php vendor/bin/phpunit
49+
docker-compose exec php85 sh -c "COMPOSER_VENDOR_DIR=vendor85 vendor85/bin/phpunit"
50+
51+
ci-local:
52+
act -j build

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@
4545
"phpstan/phpstan-doctrine": "^1.0",
4646
"phpstan/phpstan-symfony": "^1.0",
4747
"phpstan/phpstan-webmozart-assert": "^1.0",
48+
"phpstan/extension-installer": "^1.0",
4849
"symfony/framework-bundle": "^5.0 || ^6.0 || ^7.0",
4950
"doctrine/doctrine-bundle": "^2.0",
5051
"symfony/test-pack": "^1.0"
5152
},
5253
"config": {
5354
"allow-plugins": {
54-
"composer/package-versions-deprecated": true
55+
"composer/package-versions-deprecated": true,
56+
"phpstan/extension-installer": true
5557
}
5658
}
5759
}

docker-compose.override.yml.dist

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
version: '3.8'
2-
31
services:
4-
php:
2+
php81:
53
environment:
64
XDEBUG_MODE: develop,debug
75
XDEBUG_CLIENT_HOST: host.docker.internal
86
XDEBUG_CLIENT_PORT: 9090
97
PHP_IDE_CONFIG: serverName=andanteproject-nullable-embeddable-bundle
108
XDEBUG_START_WITH_REQUEST: yes
9+
10+
php85:
11+
environment:
12+
XDEBUG_MODE: develop,debug
13+
XDEBUG_CLIENT_HOST: host.docker.internal
14+
XDEBUG_CLIENT_PORT: 9091
15+
PHP_IDE_CONFIG: serverName=andanteproject-nullable-embeddable-bundle
16+
XDEBUG_START_WITH_REQUEST: yes

docker-compose.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
version: '3.8'
2-
31
services:
4-
php:
2+
php81:
53
build:
64
context: .
7-
dockerfile: docker/Dockerfile
5+
dockerfile: docker/Dockerfile.php81
86
volumes:
97
- .:/var/www/html
108
ports:
@@ -15,3 +13,18 @@ services:
1513
XDEBUG_CLIENT_PORT: ${XDEBUG_CLIENT_PORT:-9090}
1614
PHP_IDE_CONFIG: ${PHP_IDE_CONFIG:-serverName=andanteproject-nullable-embeddable-bundle}
1715
XDEBUG_START_WITH_REQUEST: ${XDEBUG_START_WITH_REQUEST:-yes}
16+
17+
php85:
18+
build:
19+
context: .
20+
dockerfile: docker/Dockerfile.php85
21+
volumes:
22+
- .:/var/www/html
23+
ports:
24+
- "9001:9000" # Use a different port for PHP 8.5
25+
environment:
26+
XDEBUG_MODE: ${XDEBUG_MODE:-develop,debug}
27+
XDEBUG_CLIENT_HOST: ${XDEBUG_CLIENT_HOST:-host.docker.internal}
28+
XDEBUG_CLIENT_PORT: ${XDEBUG_CLIENT_PORT:-9090}
29+
PHP_IDE_CONFIG: ${PHP_IDE_CONFIG:-serverName=andanteproject-nullable-embeddable-bundle}
30+
XDEBUG_START_WITH_REQUEST: ${XDEBUG_START_WITH_REQUEST:-yes}

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.4-fpm-alpine
1+
FROM php:8.5-rc-fpm-alpine
22

33
# Install dependencies
44
RUN apk add --no-cache \

docker/Dockerfile.php81

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM php:8.1-fpm-alpine
2+
3+
# Install dependencies
4+
RUN apk add --no-cache \
5+
git \
6+
unzip \
7+
libzip-dev \
8+
icu-dev \
9+
libpq-dev \
10+
oniguruma-dev \
11+
libxml2-dev \
12+
autoconf \
13+
gcc \
14+
g++ \
15+
make \
16+
linux-headers \
17+
&& docker-php-ext-install \
18+
pdo_mysql \
19+
zip \
20+
intl \
21+
pdo_pgsql \
22+
mbstring \
23+
soap \
24+
xml \
25+
&& docker-php-ext-enable \
26+
pdo_mysql \
27+
zip \
28+
intl \
29+
pdo_pgsql \
30+
mbstring \
31+
soap \
32+
xml
33+
34+
# Install Xdebug
35+
RUN pecl install xdebug \
36+
&& docker-php-ext-enable xdebug
37+
38+
# Install Composer
39+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
40+
41+
COPY docker/php/conf.d/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
42+
43+
WORKDIR /var/www/html
44+
45+
CMD ["php-fpm"]

docker/Dockerfile.php85

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM php:8.5-rc-fpm-alpine
2+
3+
# Install dependencies
4+
RUN apk add --no-cache \
5+
git \
6+
unzip \
7+
libzip-dev \
8+
icu-dev \
9+
libpq-dev \
10+
oniguruma-dev \
11+
libxml2-dev \
12+
autoconf \
13+
gcc \
14+
g++ \
15+
make \
16+
linux-headers \
17+
&& docker-php-ext-install \
18+
pdo_mysql \
19+
zip \
20+
intl \
21+
pdo_pgsql \
22+
mbstring \
23+
soap \
24+
xml \
25+
&& docker-php-ext-enable \
26+
pdo_mysql \
27+
zip \
28+
intl \
29+
pdo_pgsql \
30+
mbstring \
31+
soap \
32+
xml
33+
34+
# Install Xdebug (Currently not compatible with PHP 8.5-rc)
35+
# RUN pecl install xdebug-3.2.2 \
36+
# && docker-php-ext-enable xdebug
37+
38+
# Install Composer
39+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
40+
41+
# Configuration for Xdebug (Currently not compatible with PHP 8.5-rc)
42+
# COPY docker/php/conf.d/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
43+
44+
WORKDIR /var/www/html
45+
46+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)