diff --git a/.docker/php-8.2/Dockerfile b/.docker/php-8.4/Dockerfile similarity index 57% rename from .docker/php-8.2/Dockerfile rename to .docker/php-8.4/Dockerfile index 7736432..217f027 100644 --- a/.docker/php-8.2/Dockerfile +++ b/.docker/php-8.4/Dockerfile @@ -1,7 +1,7 @@ # Build with -# docker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/digital-craftsman-de/ids-php-8.2:latest ./.docker/php-8.2 --push +# docker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/digital-craftsman-de/ids-php-8.4:latest ./.docker/php-8.4 --push -FROM php:8.2-fpm-alpine +FROM php:8.4.0RC3-fpm-alpine RUN apk add --update \ autoconf \ @@ -15,7 +15,19 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do RUN chmod uga+x /usr/local/bin/install-php-extensions && sync # Debugging -RUN install-php-extensions xdebug +# XDebug is not yet compatible with PHP 8.4, therefore we need to build it from source. This will be replaced with the following line once XDebug is compatible with PHP 8.4: +# RUN pecl install xdebug-3.4.0 && docker-php-ext-enable xdebug +RUN apk add git +#RUN apk add -U php8-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing +RUN git clone https://github.com/xdebug/xdebug.git \ + && cd xdebug \ + && phpize \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && docker-php-ext-enable xdebug +#RUN install-php-extensions xdebug # Ids package RUN install-php-extensions uuid diff --git a/.docker/php-8.2/docker-php-ext-xdebug.ini b/.docker/php-8.4/docker-php-ext-xdebug.ini similarity index 100% rename from .docker/php-8.2/docker-php-ext-xdebug.ini rename to .docker/php-8.4/docker-php-ext-xdebug.ini diff --git a/.docker/php-8.2/php-fpm.conf b/.docker/php-8.4/php-fpm.conf similarity index 100% rename from .docker/php-8.2/php-fpm.conf rename to .docker/php-8.4/php-fpm.conf diff --git a/.docker/php-8.2/php.ini b/.docker/php-8.4/php.ini similarity index 100% rename from .docker/php-8.2/php.ini rename to .docker/php-8.4/php.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee405c9..73c3320 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,8 @@ name: CI on: push jobs: - test-8-2: - name: "Tests on PHP 8.2" + test-8-3: + name: "Tests on PHP 8.3" runs-on: ubuntu-latest steps: @@ -19,25 +19,25 @@ jobs: - name: Setup env run: cp .github/workflows/.env .env - - name: Cache PHP 8.2 dependencies - id: cache-php-8-2-dependencies + - name: Cache PHP 8.3 dependencies + id: cache-php-8-3-dependencies uses: actions/cache@v3 env: - cache-name: cache-php-8-2-dependencies + cache-name: cache-php-8-3-dependencies with: path: | ~/.cache vendor - key: ${{ runner.os }}-php-8-2-cache-${{ hashFiles('composer.lock') }} + key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} restore-keys: | - ${{ runner.os }}-php-8-2-cache-${{ hashFiles('composer.lock') }} + ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} - name: Install - if: steps.cache-php-8-2-dependencies.outputs.cache-hit != 'true' - run: make install-8.2 + if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true' + run: make install-8.3 - name: Run PHP tests - run: make php-8.2-tests-ci + run: make php-8.3-tests-ci - name: Upload to Codecov uses: codecov/codecov-action@v2 @@ -46,8 +46,8 @@ jobs: files: ./coverage.xml verbose: true - test-8-3: - name: "Tests on PHP 8.3" + test-8-4: + name: "Tests on PHP 8.4" runs-on: ubuntu-latest steps: @@ -63,25 +63,25 @@ jobs: - name: Setup env run: cp .github/workflows/.env .env - - name: Cache PHP 8.3 dependencies - id: cache-php-8-3-dependencies + - name: Cache PHP 8.4 dependencies + id: cache-php-8-4-dependencies uses: actions/cache@v3 env: - cache-name: cache-php-8-3-dependencies + cache-name: cache-php-8-4-dependencies with: path: | ~/.cache vendor - key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} + key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }} restore-keys: | - ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} + ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }} - name: Install - if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true' - run: make install-8.3 + if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true' + run: make install-8.4 - name: Run PHP tests - run: make php-8.3-tests-ci + run: make php-8.4-tests-ci mutation-testing: name: "Mutation tests" @@ -100,18 +100,18 @@ jobs: - name: Setup env run: cp .github/workflows/.env .env - - name: Restore cache for PHP 8.3 dependencies - id: cache-php-8-3-dependencies + - name: Restore cache for PHP 8.4 dependencies + id: cache-php-8-4-dependencies uses: actions/cache/restore@v3 with: path: | ~/.cache vendor - key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} + key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }} - name: Install - if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true' - run: make install-8.3 + if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true' + run: make install-8.4 - name: Run mutation testing run: make php-mutation-testing-ci @@ -133,18 +133,18 @@ jobs: - name: Setup env run: cp .github/workflows/.env .env - - name: Restore cache for PHP 8.3 dependencies - id: cache-php-8-3-dependencies + - name: Restore cache for PHP 8.4 dependencies + id: cache-php-8-4-dependencies uses: actions/cache/restore@v3 with: path: | ~/.cache vendor - key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }} + key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }} - name: Install - if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true' - run: make install-8.3 + if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true' + run: make install-8.4 - name: Run code validation run: make php-code-validation diff --git a/CHANGELOG.md b/CHANGELOG.md index 2106a59..0861659 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.4.0 + +- Drop support for PHP 8.2. +- Add support for PHP 8.4. + ## 1.3.0 - Added method `mapWithIdKeys(callable $mapFunction): array` to `IdList`. diff --git a/Makefile b/Makefile index bd10704..6562dc7 100644 --- a/Makefile +++ b/Makefile @@ -52,34 +52,34 @@ reset: .reset .PHONY: .reset .reset: .down .install .up -## install Install PHP dependencies with the default PHP version (8.3). +## 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.3). -.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 ## ------------------------- @@ -91,60 +91,60 @@ verify: php-code-validation php-tests php-mutation-testing ## php-tests Run the tests for all relevant PHP versions. .PHONY: php-tests -php-tests: php-8.2-tests php-8.3-tests +php-tests: php-8.3-tests php-8.4-tests ## php-tests-coverage Run the tests for all relevant PHP versions including coverage report as HTML. .PHONY: php-tests-coverage -php-tests-coverage: php-8.3-tests-html-coverage - -## 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-coverage: php-8.4-tests-html-coverage ## 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.3). .PHONY: php-code-validation php-code-validation: - docker compose run --rm php-8.2 ./vendor/bin/php-cs-fixer fix - docker compose run --rm php-8.2 ./vendor/bin/psalm --show-info=false --no-diff - docker compose run --rm php-8.2 ./vendor/bin/phpstan --xdebug + 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 + docker compose run --rm php-8.4 ./vendor/bin/phpstan --xdebug -## php-mutation-testing Run mutation testing with default PHP version (8.2). +## php-mutation-testing Run mutation testing with default PHP version (8.3). .PHONY: php-mutation-testing php-mutation-testing: - docker compose run --rm php-8.2 ./vendor/bin/infection --show-mutations --only-covered --threads=8 + docker compose run --rm php-8.4 ./vendor/bin/infection --show-mutations --only-covered --threads=8 ## ## 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 --coverage-clover ./coverage.xml - ## 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 + 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 ## php-mutation-testing-ci Run mutation testing for CI. .PHONY: php-mutation-testing-ci php-mutation-testing-ci: - docker compose run --rm php-8.2 ./vendor/bin/infection --only-covered --threads=max + docker compose run --rm php-8.4 ./vendor/bin/infection --only-covered --threads=max diff --git a/README.md b/README.md index 5d970c7..14b6e77 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A Symfony bundle to work with id and id list value objects in Symfony. It includ As it's a central part of an application, it's tested thoroughly (including mutation testing). [![Latest Stable Version](https://img.shields.io/badge/stable-1.3.0-blue)](https://packagist.org/packages/digital-craftsman/ids) -[![PHP Version Require](https://img.shields.io/badge/php-8.2|8.3-5b5d95)](https://packagist.org/packages/digital-craftsman/ids) +[![PHP Version Require](https://img.shields.io/badge/php-8.3|8.4-5b5d95)](https://packagist.org/packages/digital-craftsman/ids) [![codecov](https://codecov.io/gh/digital-craftsman-de/ids/branch/main/graph/badge.svg?token=BL0JKZYLBG)](https://codecov.io/gh/digital-craftsman-de/ids) ![Packagist Downloads](https://img.shields.io/packagist/dt/digital-craftsman/ids) ![Packagist License](https://img.shields.io/packagist/l/digital-craftsman/ids) diff --git a/UPGRADE.md b/UPGRADE.md index 9e9d743..77ff85d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,11 @@ # Upgrade guide +## From 1.3.* to 1.4.0 + +### Upgrade to at least PHP 8.3 + +Support for PHP 8.2 was dropped, so you have to upgrade to at least PHP 8.3. + ## From 1.2.* to 1.3.0 Nothing to do. diff --git a/composer.json b/composer.json index 184769d..e92e778 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Working with value objects for ids in Symfony", "type": "symfony-bundle", "require": { - "php": "8.2.*|8.3.*", + "php": "8.3.*|8.4.*", "symfony/framework-bundle": "^6.3|^7.0", "symfony/serializer": "^6.3|^7.0", "doctrine/dbal": "^2.13.8|^3.3.6", diff --git a/docker-compose.yml b/docker-compose.yml index 913ac1e..a0fa248 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: - php-8.2: - image: ghcr.io/digital-craftsman-de/ids-php-8.2 + php-8.3: + image: ghcr.io/digital-craftsman-de/ids-php-8.3 env_file: - .env volumes: @@ -9,8 +9,8 @@ services: extra_hosts: - "host.docker.internal:host-gateway" - php-8.3: - image: ghcr.io/digital-craftsman-de/ids-php-8.3 + php-8.4: + image: ghcr.io/digital-craftsman-de/ids-php-8.4 env_file: - .env volumes: