From 54897b42d27b673087dfe17a0a9b7beb81469b4f Mon Sep 17 00:00:00 2001 From: velkuns Date: Wed, 24 Dec 2025 16:15:10 +0100 Subject: [PATCH] Component Database upgrade - Add PHP 8.3+ only - Drop PHP 7.4 support - Drop PHP 8.1 support - Drop PHP 8.2 support - Use PER Code Style 3.0 - Update CI config --- .github/workflows/ci.yml | 2 +- .github/workflows/sonarcloud.yml | 6 +++--- .gitignore | 1 - .php-cs-fixer.dist.php | 2 +- CHANGELOG.md | 13 +++++++++++++ Makefile | 12 +++++++----- README.md | 2 +- ci/phpmax-compatibility.neon | 2 +- ci/phpmin-compatibility.neon | 2 +- composer.json | 14 +++++++------- phpstan.neon.dist | 2 +- phpunit.xml.dist | 20 ++++---------------- 12 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eba7166..10b872c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] + php-versions: [ '8.3', '8.4', '8.5' ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 3b075ca..2a5caa3 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -15,10 +15,10 @@ jobs: fetch-depth: 0 # To avoid "Shallow clone detected" error in SonarCloud report #~ PHP Setup - - name: Setup PHP 8.1 # Minimum version + - name: Setup PHP 8.3 # Minimum version uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.3' #~ Composer Cache - name: Get Composer Cache Directory @@ -41,6 +41,6 @@ jobs: run: make php/tests # To generate the coverage report - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@v5.2.0 + uses: SonarSource/sonarqube-scan-action@v7 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.gitignore b/.gitignore index 0fd1213..d38d3f4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ composer.lock #~ Tests /build/* -.phpunit.result.cache #~ Misc .idea diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index de5ea3b..d16dbbd 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,7 +4,7 @@ //~ Rules ->setRules( [ - '@PER-CS2.0' => true, + '@PER-CS3x0' => true, ] ) diff --git a/CHANGELOG.md b/CHANGELOG.md index e006b65..8cc1afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [4.0.0] - 2025-12-24 +[4.0.0]: https://github.com/eureka-framework/component-database/compare/3.4.0...4.0.0 +### Added +- Add PHP 8.3+ only +### Removed +- Drop PHP 7.4 support +- Drop PHP 8.1 support +- Drop PHP 8.2 support +### Changed +- Use PER Code Style 3.0 +- Update CI config + + ## [3.4.0] - 2025-05-16 [3.4.0]: https://github.com/eureka-framework/component-database/compare/3.3.0...3.4.0 ### Changed diff --git a/Makefile b/Makefile index ba66a38..199be3e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .PHONY: validate install update php/deps php/check php/fix php/min-compatibility php/max-compatibility php/phpstan php/analyze php/tests php/test php/testdox ci clean +PHP_MIN_VERSION := "8.3" +PHP_MAX_VERSION := "8.5" COMPOSER_BIN := composer define header = @if [ -t 1 ]; then printf "\n\e[37m\e[100m \e[104m $(1) \e[0m\n"; else printf "\n### $(1)\n"; fi @@ -40,17 +42,17 @@ php/deps: composer.json php/check: vendor/bin/php-cs-fixer $(call header,Checking Code Style) - @PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer check -v --diff + @XDEBUG_MODE=off ./vendor/bin/php-cs-fixer check php/fix: vendor/bin/php-cs-fixer $(call header,Fixing Code Style) - @PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix -v + @XDEBUG_MODE=off ./vendor/bin/php-cs-fixer fix -v php/min-compatibility: vendor/bin/phpstan build/reports/phpstan - $(call header,Checking PHP 7.4 compatibility) + $(call header,Checking PHP ${PHP_MIN_VERSION} compatibility) @XDEBUG_MODE=off ./vendor/bin/phpstan analyse --configuration=./ci/phpmin-compatibility.neon --error-format=table php/max-compatibility: vendor/bin/phpstan build/reports/phpstan #ci - $(call header,Checking PHP 8.4 compatibility) + $(call header,Checking PHP ${PHP_MAX_VERSION} compatibility) @XDEBUG_MODE=off ./vendor/bin/phpstan analyse --configuration=./ci/phpmax-compatibility.neon --error-format=table php/analyze: vendor/bin/phpstan build/reports/phpstan #manual & ci @@ -59,7 +61,7 @@ php/analyze: vendor/bin/phpstan build/reports/phpstan #manual & ci php/tests: vendor/bin/phpunit build/reports/phpunit #ci $(call header,Running Unit Tests) - @XDEBUG_MODE=coverage php -dzend_extension=xdebug.so ./vendor/bin/phpunit --testsuite=unit --coverage-clover=./build/reports/phpunit/clover.xml --log-junit=./build/reports/phpunit/unit.xml --coverage-php=./build/reports/phpunit/unit.cov --coverage-html=./build/reports/coverage/ --fail-on-warning + @XDEBUG_MODE=coverage php ./vendor/bin/phpunit --testsuite=unit --coverage-clover=./build/reports/phpunit/clover.xml --log-junit=./build/reports/phpunit/unit.xml --coverage-php=./build/reports/phpunit/unit.cov --coverage-html=./build/reports/coverage/ --fail-on-warning php/test: php/tests diff --git a/README.md b/README.md index da2e9fd..61c0fbf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # component-database [![Current version](https://img.shields.io/packagist/v/eureka/component-database.svg?logo=composer)](https://packagist.org/packages/eureka/component-database) -[![Supported PHP version](https://img.shields.io/static/v1?logo=php&label=PHP&message=7.4-8.4&color=777bb4)](https://packagist.org/packages/eureka/component-database) +[![Supported PHP version](https://img.shields.io/static/v1?logo=php&label=PHP&message=>%3D8.3&color=777bb4)](https://packagist.org/packages/eureka/component-database) ![CI](https://github.com/eureka-framework/component-database/workflows/CI/badge.svg) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=eureka-framework_component-database&metric=alert_status)](https://sonarcloud.io/dashboard?id=eureka-framework_component-database) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=eureka-framework_component-database&metric=coverage)](https://sonarcloud.io/dashboard?id=eureka-framework_component-database) diff --git a/ci/phpmax-compatibility.neon b/ci/phpmax-compatibility.neon index 31e7b6b..162415e 100644 --- a/ci/phpmax-compatibility.neon +++ b/ci/phpmax-compatibility.neon @@ -3,7 +3,7 @@ includes: - ./../vendor/phpstan/phpstan-phpunit/rules.neon parameters: - phpVersion: 80400 + phpVersion: 80500 level: 0 paths: - ./../src diff --git a/ci/phpmin-compatibility.neon b/ci/phpmin-compatibility.neon index 1082da1..729fb51 100644 --- a/ci/phpmin-compatibility.neon +++ b/ci/phpmin-compatibility.neon @@ -3,7 +3,7 @@ includes: - ./../vendor/phpstan/phpstan-phpunit/rules.neon parameters: - phpVersion: 70400 + phpVersion: 80300 level: 0 paths: - ./../src diff --git a/composer.json b/composer.json index 2427776..0705cf2 100644 --- a/composer.json +++ b/composer.json @@ -26,16 +26,16 @@ }, "require": { - "php": "7.4.*||8.0.*||8.1.*||8.2.*||8.3.*||8.4.*", + "php": ">=8.3", "ext-pdo": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.75.0", - "phpstan/phpstan": "^2.1.16", - "phpstan/phpstan-phpunit": "^2.0.6", - "phpunit/phpcov": "^8.2.1", - "phpunit/phpunit": "^9.6.23", - "shipmonk/composer-dependency-analyser": "^1.8.3" + "friendsofphp/php-cs-fixer": "^3.92.3", + "phpstan/phpstan": "^2.1.33", + "phpstan/phpstan-phpunit": "^2.0.11", + "phpunit/phpcov": "^11.0.3", + "phpunit/phpunit": "^12.5.4", + "shipmonk/composer-dependency-analyser": "^1.8.4" } } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1849cfd..d884d8b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -3,7 +3,7 @@ includes: - ./vendor/phpstan/phpstan-phpunit/rules.neon parameters: - phpVersion: 70400 + phpVersion: 80300 level: max paths: - ./src diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4ba5312..0f4fcc5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,24 +1,12 @@ - - - ./src - - - - - - ./tests/unit - - - +