Skip to content

Commit

Permalink
Add support for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Feb 1, 2025
1 parent 3a16f17 commit 19dfd90
Show file tree
Hide file tree
Showing 15 changed files with 1,929 additions and 753 deletions.
4 changes: 2 additions & 2 deletions .docker/php-8.2/Dockerfile → .docker/php-8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build with
# docker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/digital-craftsman-de/cqs-routing-php-8.2:latest ./.docker/php-8.2 --push
# docker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/digital-craftsman-de/cqs-routing-php-8.4:latest ./.docker/php-8.4 --push

FROM php:8.2-fpm-alpine
FROM php:8.4-fpm-alpine

RUN apk add --update \
autoconf \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ APP_SECRET=afc97c0191ec1dcfa6494f276e6a6cfa
DATABASE_URL=pgsql://symfony:symfony@db:5432/symfony
TEST_DATABASE_URL=pgsql://symfony:symfony@db:5432/symfony-test
###< doctrine/doctrine-bundle ###

# PHP-CS-Fixer is not officially compatible with PHP 8.4 yet.
PHP_CS_FIXER_IGNORE_ENV=1
3 changes: 3 additions & 0 deletions .github/workflows/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ APP_SECRET=afc97c0191ec1dcfa6494f276e6a6cfa
DATABASE_URL=pgsql://symfony:symfony@db:5432/symfony
TEST_DATABASE_URL=pgsql://symfony:symfony@db:5432/symfony-test
###< doctrine/doctrine-bundle ###

# PHP-CS-Fixer is not officially compatible with PHP 8.4 yet.
PHP_CS_FIXER_IGNORE_ENV=1
64 changes: 32 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,34 @@ reset: .reset
.PHONY: .reset
.reset: .down .install .up

## install Install PHP dependencies with the default PHP version (8.2).
## install Install PHP dependencies with the default PHP version (8.4).
.PHONY: .install
install: install-8.3

## install-8.2 Install PHP dependencies with PHP 8.2.
.PHONY: install-8.2
install-8.2:
docker compose run --rm php-8.2 composer install
install: install-8.4

## install-8.3 Install PHP dependencies with PHP 8.3.
.PHONY: install-8.3
install-8.3:
docker compose run --rm php-8.3 composer install

## php-cli Enter a shell for the default PHP version (8.2).
.PHONY: php-cli
php-cli: php-8.3-cli
## install-8.4 Install PHP dependencies with PHP 8.4.
.PHONY: install-8.4
install-8.4:
docker compose run --rm php-8.4 composer install

## php-8.2-cli Enter a shell for PHP 8.2.
.PHONY: php-8.2-cli
php-8.2-cli:
docker compose run --rm php-8.2 sh
## php-cli Enter a shell for the default PHP version (8.4).
.PHONY: php-cli
php-cli: php-8.4-cli

## php-8.3-cli Enter a shell for PHP 8.3.
.PHONY: php-8.3-cli
php-8.3-cli:
docker compose run --rm php-8.3 sh

## php-8.4-cli Enter a shell for PHP 8.4.
.PHONY: php-8.4-cli
php-8.4-cli:
docker compose run --rm php-8.4 sh

##
## Tests and code validation
## -------------------------
Expand All @@ -91,45 +91,45 @@ verify: php-code-validation php-tests

## php-tests Run the tests for all relevant PHP versions.
.PHONY: php-tests
php-tests: php-8.2-tests php-8.3-tests

## php-8.2-tests Run tests with PHP 8.2.
.PHONY: php-8.2-tests
php-8.2-tests:
docker compose run --rm php-8.2 ./vendor/bin/phpunit
php-tests: php-8.3-tests php-8.4-tests

## php-8.3-tests Run tests with PHP 8.3.
.PHONY: php-8.3-tests
php-8.3-tests:
docker compose run --rm php-8.3 ./vendor/bin/phpunit

## php-8.2-tests-html-coverage Run the tests with PHP 8.2 including coverage report as HTML.
.PHONY: php-8.2-tests-html-coverage
php-8.2-tests-html-coverage:
docker compose run --rm php-8.2 ./vendor/bin/phpunit --coverage-html ./coverage
## php-8.4-tests Run tests with PHP 8.4.
.PHONY: php-8.4-tests
php-8.4-tests:
docker compose run --rm php-8.4 ./vendor/bin/phpunit

## php-8.3-tests-html-coverage Run the tests with PHP 8.3 including coverage report as HTML.
.PHONY: php-8.3-tests-html-coverage
php-8.3-tests-html-coverage:
docker compose run --rm php-8.3 ./vendor/bin/phpunit --coverage-html ./coverage

## php-code-validation Run code fixers and linters with default PHP version (8.2).
## php-8.4-tests-html-coverage Run the tests with PHP 8.4 including coverage report as HTML.
.PHONY: php-8.4-tests-html-coverage
php-8.4-tests-html-coverage:
docker compose run --rm php-8.4 ./vendor/bin/phpunit --coverage-html ./coverage

## php-code-validation Run code fixers and linters with default PHP version (8.4).
.PHONY: php-code-validation
php-code-validation:
docker compose run --rm php-8.3 ./vendor/bin/php-cs-fixer fix
docker compose run --rm php-8.3 ./vendor/bin/psalm --show-info=false --no-diff
docker compose run --rm php-8.4 ./vendor/bin/php-cs-fixer fix
docker compose run --rm php-8.4 ./vendor/bin/psalm --show-info=false --no-diff

##
## CI
## --
##

## php-8.2-tests-ci Run the tests for PHP 8.2 for CI.
.PHONY: php-8.2-tests-ci
php-8.2-tests-ci:
docker compose run --rm php-8.2 ./vendor/bin/phpunit

## php-8.3-tests-ci Run the tests for PHP 8.3 for CI.
.PHONY: php-8.3-tests-ci
php-8.3-tests-ci:
docker compose run --rm php-8.3 ./vendor/bin/phpunit --coverage-clover ./coverage.xml

## php-8.4-tests-ci Run the tests for PHP 8.4 for CI.
.PHONY: php-8.4-tests-ci
php-8.4-tests-ci:
docker compose run --rm php-8.4 ./vendor/bin/phpunit
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"description": "Reduced cost of change through CQS in Symfony",
"type": "symfony-bundle",
"require": {
"php": "8.2.*|8.3.*",
"php": "8.3.*|8.4.*",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/serializer": "^6.4|^7.0"
},
"require-dev": {
"digital-craftsman/ids": "0.13.*",
"friendsofphp/php-cs-fixer": "^3.15",
"digital-craftsman/ids": "^2.0.1",
"friendsofphp/php-cs-fixer": "^3.68.5",
"phpunit/phpunit": "^10.5",
"symfony/property-access": "^7.0",
"symfony/property-info": "^7.0",
"symfony/yaml": "^7.0",
"vimeo/psalm": "^5.17"
"vimeo/psalm": "^6.0.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 19dfd90

Please sign in to comment.