diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3633fe5..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: [ '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 f3810fa..9130fbb 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,4 +1,4 @@ -name: CI +name: SonarQube on: push: @@ -41,6 +41,6 @@ jobs: run: make php/tests # To generate the coverage report - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@v6.0.0 + uses: SonarSource/sonarqube-scan-action@v7 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1eb221a..c36d041 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -5,7 +5,7 @@ ->setRules( [ '@PER-CS3x0' => true, - ] + ], ) //~ Format diff --git a/CHANGELOG.md b/CHANGELOG.md index c34a23b..9460732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Removed ``` +## [7.1.0] - 2026-01-05 +[7.1.0]: https://github.com/eureka-framework/component-orm/compare/7.0.0...7.1.0 +### Added +- PHP 8.5 support +### Changed +- Fix phpstan error +- PHP code style fixes +- Update CI +- Update Makefile + ## [7.0.0] - 2025-08-25 [7.0.0]: https://github.com/eureka-framework/component-orm/compare/6.1.0...7.0.0 ### Added diff --git a/Makefile b/Makefile index 02253cb..5932d3f 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .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_VERSION_MIN := 8.3 -PHP_VERSION_MAX := 8.4 - +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 endef @@ -10,23 +10,23 @@ endef #~ Composer dependency validate: $(call header,Composer Validation) - @composer validate + @${COMPOSER_BIN} validate install: $(call header,Composer Install) - @composer install + @${COMPOSER_BIN} install update: $(call header,Composer Update) - @composer update - @composer bump --dev-only + @${COMPOSER_BIN} update + @${COMPOSER_BIN} bump --dev-only composer.lock: install #~ Vendor binaries dependencies -vendor/bin/php-cs-fixer: -vendor/bin/phpstan: -vendor/bin/phpunit: +vendor/bin/php-cs-fixer: composer.lock +vendor/bin/phpstan: composer.lock +vendor/bin/phpunit: composer.lock #~ Report directories dependencies build/reports/phpunit: @@ -42,24 +42,26 @@ php/deps: composer.json php/check: vendor/bin/php-cs-fixer $(call header,Checking Code Style) - @./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) - @./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 ${PHP_VERSION_MIN} 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 ${PHP_VERSION_MAX} 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 $(call header,Running Static Analyze - Pretty tty format) @XDEBUG_MODE=off ./vendor/bin/phpstan analyse --error-format=table +php/clean-tests: + $(call header,Clean previous generated classes from tests) + php/tests: vendor/bin/phpunit build/reports/phpunit #ci $(call header,Running Unit Tests) @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 @@ -78,4 +80,10 @@ clean: $(call header,Cleaning previous build) #manual @if [ "$(shell ls -A ./build)" ]; then rm -rf ./build/*; fi; echo " done" -ci: clean validate install php/deps php/check php/tests php/integration php/min-compatibility php/max-compatibility php/analyze +clean-tests: + $(call header,Cleaning generated classes from tests) #manual + @if [ "$(shell ls -A ./tests/unit/Generated/Entity)" ]; then rm -rf ./tests/unit/Generated/Entity; fi; echo " . Removing entities: done" + @if [ "$(shell ls -A ./tests/unit/Generated/Infrastructure)" ]; then rm -rf ./tests/unit/Generated/Infrastructure; fi; echo " . Removing infrastructure: done" + @if [ "$(shell ls -A ./tests/unit/Generated/Repository)" ]; then rm -rf ./tests/unit/Generated/Repository; fi; echo " . Removing repositories: done" + +ci: clean clean-tests validate install php/deps php/check php/tests php/integration php/min-compatibility php/max-compatibility php/analyze diff --git a/README.md b/README.md index 8aca89c..e8d9070 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # component-orm [![Current version](https://img.shields.io/packagist/v/eureka/component-orm.svg?logo=composer)](https://packagist.org/packages/eureka/component-orm) -[![Supported PHP version](https://img.shields.io/static/v1?logo=php&label=PHP&message=8.3%20-%208.4&color=777bb4)](https://packagist.org/packages/eureka/component-orm) +[![Supported PHP version](https://img.shields.io/static/v1?logo=php&label=PHP&message=>%3D8.3&color=777bb4)](https://packagist.org/packages/eureka/component-orm) ![CI](https://github.com/eureka-framework/component-orm/workflows/CI/badge.svg) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=eureka-framework_component-orm&metric=alert_status)](https://sonarcloud.io/dashboard?id=eureka-framework_component-orm) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=eureka-framework_component-orm&metric=coverage)](https://sonarcloud.io/dashboard?id=eureka-framework_component-orm) diff --git a/ci/phpmax-compatibility.neon b/ci/phpmax-compatibility.neon index 2c7cc0b..085b5a0 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/composer.json b/composer.json index eb7d3c4..a902cca 100644 --- a/composer.json +++ b/composer.json @@ -31,24 +31,24 @@ }, "require": { - "php": "8.3.*||8.4.*", + "php": ">=8.3", "ext-pdo": "*", - "eureka/component-database": "^3.4", + "eureka/component-database": "^4.0", "eureka/component-validation": "^6.0", - "eureka/component-console": "^6.3", + "eureka/component-console": "^7.0", "psr/cache": "^1.0||^2.0||^3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.89.2", - "phpstan/phpstan": "^2.1.31", - "phpstan/phpstan-phpunit": "^2.0.7", + "friendsofphp/php-cs-fixer": "^3.92.4", + "phpstan/phpstan": "^2.1.33", + "phpstan/phpstan-phpunit": "^2.0.11", "phpstan/phpstan-strict-rules": "^2.0.7", - "phpunit/phpcov": "^11.0.2", - "phpunit/phpunit": "^12.4.2", - "symfony/cache": "^7.3.6", - "shipmonk/composer-dependency-analyser": "^1.8.3" + "phpunit/phpcov": "^11.0.3", + "phpunit/phpunit": "^12.5.4", + "symfony/cache": "^7.4.3", + "shipmonk/composer-dependency-analyser": "^1.8.4" } }