From 34a58d4770de139f906088685d2649714ebcd566 Mon Sep 17 00:00:00 2001 From: Jairo Correa Date: Thu, 14 Mar 2024 20:54:10 -0300 Subject: [PATCH] Laravel 11 --- CHANGELOG-3.x.md | 7 ++++- Makefile | 61 ++++++++++++++++++++++++++++++++------------ README.md | 1 + composer.json | 9 +++---- phpstan.neon | 2 +- phpunit-coverage.xml | 21 ++++++++------- phpunit.xml | 11 +++----- 7 files changed, 71 insertions(+), 41 deletions(-) diff --git a/CHANGELOG-3.x.md b/CHANGELOG-3.x.md index c814bf3..b919495 100644 --- a/CHANGELOG-3.x.md +++ b/CHANGELOG-3.x.md @@ -1,6 +1,11 @@ # Changelog -## [Unreleased](https://github.com/jn-jairo/laravel-eloquent-cast/compare/v3.0.0...3.x) +## [Unreleased](https://github.com/jn-jairo/laravel-eloquent-cast/compare/v3.0.1...3.x) + +## [v3.0.1 (2024-03-14)](https://github.com/jn-jairo/laravel-eloquent-cast/compare/v3.0.0...v3.0.1) + +### Added +- Laravel 11 support ## [v3.0.0 (2023-03-02)](https://github.com/jn-jairo/laravel-eloquent-cast/compare/v2.0.5...v3.0.0) diff --git a/Makefile b/Makefile index 6d55502..46f2194 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ STABLE_DEPS += '8.1|9.0|7.0' STABLE_DEPS += '8.1|10.0|8.0' STABLE_DEPS += '8.2|9|7.0' STABLE_DEPS += '8.2|10.0|8.0' +STABLE_DEPS += '8.2|11.0|9.0' +STABLE_DEPS += '8.3|10.0|8.0' +STABLE_DEPS += '8.3|11.0|9.0' # php_version|laravel_version|orchestra_version LOWEST_DEPS += '8.1|8.83|6.24' @@ -11,6 +14,9 @@ LOWEST_DEPS += '8.1|9.0|7.0' LOWEST_DEPS += '8.1|10.0|8.0' LOWEST_DEPS += '8.2|9|7.0' LOWEST_DEPS += '8.2|10.0|8.0' +LOWEST_DEPS += '8.2|11.0|9.0' +LOWEST_DEPS += '8.3|10.0|8.0' +LOWEST_DEPS += '8.3|11.0|9.0' define show_title title=$1 ; \ @@ -28,6 +34,10 @@ define composer_update composer update --prefer-dist --no-interaction --prefer-stable endef +define clean_cache + (rm -r .phpunit.cache > /dev/null 2>&1 || true) ; +endef + define test_version versions="$1" ; \ composer_args=$2 ; \ @@ -36,6 +46,7 @@ define test_version orchestra_version=$$(echo $${versions} | cut -d'|' -f 3); \ if command -v php$${php_version} > /dev/null 2>&1 ; \ then \ + $(call clean_cache) \ $(call show_title,'PHP: '$${php_version}' LARAVEL: '$${laravel_version}' ORCHESTRA: '$${orchestra_version}) \ echo -n 'Updating dependencies... ' ; \ output_composer=$$(php$${php_version} $$(which composer) update --prefer-dist --no-interaction $${composer_args} --prefer-stable --with=laravel/framework:^$${laravel_version} --with=orchestra/testbench:^$${orchestra_version} --with=orchestra/testbench-core:^$${orchestra_version} 2>&1) ; \ @@ -56,6 +67,7 @@ define test_version continue ; \ fi; \ echo 'OK' ; \ + $(call clean_cache) \ fi; endef @@ -66,10 +78,10 @@ fast: parallel-test code-fix code-style slow: parallel-test code-fix code-style static-analysis .PHONY: coverage -coverage: test-coverage infection-test +coverage: test-coverage .PHONY: coverage-show -coverage-show: test-coverage infection-test show-coverage show-infection +coverage-show: test-coverage show-coverage .PHONY: composer-update composer-update: @@ -77,13 +89,16 @@ composer-update: .PHONY: test test: + @$(call clean_cache) @$(call show_title,'TEST') \ vendor/bin/pest \ --do-not-cache-result \ $(ARGS) + @$(call clean_cache) .PHONY: test-coverage -test-coverage: clear-coverage +test-coverage: clean-coverage + @$(call clean_cache) @$(call show_title,'TEST COVERAGE') \ XDEBUG_MODE=coverage \ php -d zend_extension=xdebug.so \ @@ -91,35 +106,42 @@ test-coverage: clear-coverage --configuration phpunit-coverage.xml \ --do-not-cache-result \ --coverage + @$(call clean_cache) .PHONY: test-stable test-stable: + @$(call clean_cache) @$(call show_title,'TEST STABLE') \ for versions in $(STABLE_DEPS) ; \ do \ $(call test_version,$${versions}) \ done; \ $(call composer_update) > /dev/null 2>&1 + @$(call clean_cache) .PHONY: test-lowest test-lowest: + @$(call clean_cache) @$(call show_title,'TEST LOWEST') \ for versions in $(LOWEST_DEPS) ; \ do \ $(call test_version,$${versions},--prefer-lowest) \ done; \ $(call composer_update) > /dev/null 2>&1 + @$(call clean_cache) .PHONY: parallel-test parallel-test: + @$(call clean_cache) @$(call show_title,'PARALLEL TEST') \ vendor/bin/pest \ --parallel \ - --processes=$(shell nproc) \ - --passthru="--do-not-cache-result" + --processes=$(shell nproc) + @$(call clean_cache) .PHONY: parallel-test-coverage -parallel-test-coverage: clear-coverage +parallel-test-coverage: clean-coverage + @$(call clean_cache) @$(call show_title,'PARALLEL TEST COVERAGE') \ XDEBUG_MODE=coverage \ php -d zend_extension=xdebug.so \ @@ -128,17 +150,19 @@ parallel-test-coverage: clear-coverage --processes=$(shell nproc) \ --configuration=phpunit-coverage.xml \ --passthru-php="-d zend_extension=xdebug.so" \ - --passthru="--do-not-cache-result" \ --coverage + @$(call clean_cache) .PHONY: infection-test -infection-test: clear-infection +infection-test: clean-infection + @$(call clean_cache) @$(call show_title,'INFECTION TEST') \ infection \ --threads=$(shell nproc) \ --coverage=build/coverage \ --skip-initial-tests \ --test-framework=pest + @$(call clean_cache) .PHONY: code-fix code-fix: @@ -164,15 +188,20 @@ show-coverage: show-infection: @xdg-open build/infection/infection.html > /dev/null 2>&1 -.PHONY: clear -clear: clear-coverage clear-infection +.PHONY: clean +clean: clean-cache clean-coverage clean-infection + +.PHONY: clean-cache +clean-cache: + @$(call show_title,'CLEAN CACHE') \ + (rm -r .phpunit.cache > /dev/null 2>&1 || true) -.PHONY: clear-coverage -clear-coverage: - @$(call show_title,'CLEAR COVERAGE') \ +.PHONY: clean-coverage +clean-coverage: + @$(call show_title,'CLEAN COVERAGE') \ (rm -r build/coverage > /dev/null 2>&1 || true) -.PHONY: clear-infection -clear-infection: - @$(call show_title,'CLEAR INFECTION') \ +.PHONY: clean-infection +clean-infection: + @$(call show_title,'CLEAN INFECTION') \ (rm -r build/infection > /dev/null 2>&1 || true) diff --git a/README.md b/README.md index ae89dc4..191d4b4 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ with the [jn-jairo/laravel-cast](https://github.com/jn-jairo/laravel-cast) packa 8.x | 3.x 9.x | 3.x 10.x | 3.x + 11.x | 3.x ## Installation diff --git a/composer.json b/composer.json index dbb093c..bbb1004 100644 --- a/composer.json +++ b/composer.json @@ -15,13 +15,12 @@ ], "require": { "php": "^8.1", - "illuminate/support": "^8.83|^9.0|^10.0", - "jn-jairo/laravel-cast": "^2.0" + "illuminate/support": "^8.83|^9.0|^10.0|^11.0", + "jn-jairo/laravel-cast": "^2.0.1" }, "require-dev": { - "orchestra/testbench": "^6.24|^7.0|^8.0", - "pestphp/pest": "^1.22", - "pestphp/pest-plugin-parallel": "^1.2", + "orchestra/testbench": "^6.24|^7.0|^8.0|^9.0", + "pestphp/pest": "^1.22|^2.34", "php-decimal/php-decimal": "^1.1" }, "autoload": { diff --git a/phpstan.neon b/phpstan.neon index 99391c3..7850418 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -8,7 +8,7 @@ parameters: - '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::#' - '#Access to an undefined property JnJairo\\Laravel\\EloquentCast\\Tests\\Fixtures\\DummyModel::#' - '#Call to an undefined method JnJairo\\Laravel\\EloquentCast\\Tests\\Fixtures\\DummyModel::#' - - '#Call to an undefined method Pest\\Expectation\\|Pest\\Support\\Extendable::#' - '#Call to protected method .* of class Orchestra\\Testbench\\TestCase#' - '#If condition is always true#' - '#Variable \$deprecated in empty\(\) always exists and is not falsy#' + - '#Unable to resolve the template type TValue in call to function expect#' diff --git a/phpunit-coverage.xml b/phpunit-coverage.xml index 1eaa7af..14bae7b 100644 --- a/phpunit-coverage.xml +++ b/phpunit-coverage.xml @@ -1,25 +1,19 @@ - + tests - - - ./src - + @@ -29,4 +23,9 @@ + + + ./src + + diff --git a/phpunit.xml b/phpunit.xml index 65c91f6..27e7792 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,15 @@ - + tests