From 85d4e49b8660ac553a97b0d0aff097bd4be4f9dc Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Sat, 7 Dec 2024 00:29:43 +0100 Subject: [PATCH 1/7] Mark package as abandoned and update README with new package info. The `composer.json` now indicates that `dropelikeit/laravel-responsefactory` is abandoned. The README advises users to transition to a new package that offers additional functions, and support will extend only until Laravel 11's end. --- README.md | 3 +++ composer.json | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index a464f82..8d9f729 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ JMS-Serializer: https://github.com/schmittjoh/serializer You are also welcome to use the Issue Tracker to set bugs, improvements or upgrade requests. +> Please use the new package https://github.com/Dropelikeit/laravel-responsefactory in the future. The new package contains some new and useful functions! +This package will only be supported until the end of Laravel 11. Until then, you should use the new package. + ### Installation ``` composer require dropelikeit/laravel-jms-serializer ``` diff --git a/composer.json b/composer.json index 4466ba8..ddbb6cc 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "keywords": ["Lumen", "Laravel", "JMS Serializer", "JMS"], "minimum-stability": "stable", "license": "MIT", + "abandoned": "dropelikeit/laravel-responsefactory", "authors": [ { "name": "Marcel Strahl", From 66f1f37e9f56d361b617baf3e11d925551216a14 Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Sat, 7 Dec 2024 00:37:50 +0100 Subject: [PATCH 2/7] Add .php-cs-fixer.cache to .gitignore Ignore the cache file generated by PHP-CS-Fixer to prevent unintentional version control. This helps maintain a clean repository, avoiding unnecessary files from being tracked. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bec9efc..4704602 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # PHPUnit specific .phpunit.result.cache +.php-cs-fixer.cache # Composer /vendor/ From 4bf588419f6644b5e7cb9a50d46b4bbfb70e78cc Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Sat, 7 Dec 2024 00:41:43 +0100 Subject: [PATCH 3/7] Enable cache directory assertion Re-enable the assertion to ensure the cache directory is a non-empty string. This change helps prevent potential errors related to invalid cache directory configurations. Adjustments improve code reliability and enforce stricter input validation. --- src/Config/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config/Config.php b/src/Config/Config.php index 116b230..0527054 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -45,7 +45,7 @@ private function __construct( array $customHandlers, ) { $cacheDir = sprintf('%s%s', $cacheDir, self::CACHE_DIR); - #Assert::stringNotEmpty($cacheDir); + Assert::stringNotEmpty($cacheDir); $this->cacheDir = $cacheDir; $this->customHandlers = $customHandlers; From 3e57028983c09599d3554c7a7de373bb1e423e28 Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Sat, 7 Dec 2024 00:46:46 +0100 Subject: [PATCH 4/7] Remove unnecessary assertion from cache directory setup The assertion ensuring the cache directory is not empty has been removed to simplify the code, as its necessity was reevaluated. A comment has been added to suppress PHPStan warnings on this line, ensuring the codebase remains free of analysis errors. --- src/Config/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config/Config.php b/src/Config/Config.php index 0527054..ee3be57 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -45,8 +45,8 @@ private function __construct( array $customHandlers, ) { $cacheDir = sprintf('%s%s', $cacheDir, self::CACHE_DIR); - Assert::stringNotEmpty($cacheDir); + // @phpstan-ignore-next-line $this->cacheDir = $cacheDir; $this->customHandlers = $customHandlers; } From a99c97732d7cc485c0c48e8077f9e6db639cc6d1 Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Tue, 28 Jan 2025 19:59:01 +0100 Subject: [PATCH 5/7] Update dependencies and add PHP 8.4 workflow Upgraded versions of Psalm, its Laravel plugin, and Infection in `composer.json`. Simplified PHP CS Fixer command in the CI workflow. Added a new workflow to support testing and analysis for PHP 8.4. --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++-- composer.json | 6 +++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69e3afe..ab45988 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: run: "composer test-coverage" - name: "Run PHP CS Check" - run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check" + run: "composer cs-check" - name: "Run PHPStan" run: "composer analyze" @@ -119,7 +119,7 @@ jobs: run: "composer test-coverage" - name: "Run PHP CS Check" - run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check" + run: "composer cs-check" - name: "Run PHPStan" run: "composer analyze" @@ -133,4 +133,46 @@ jobs: - name: "Run infection" env: INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} + run: "composer infection-ci" + + php84: + name: PHP 8.4 + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + fetch-depth: 2 + + - name: "Install PHP 8.4" + uses: "shivammathur/setup-php@v2" + with: + php-version: "8.4" + + - name: "Cache composer packages" + uses: "actions/cache@v4" + with: + path: "vendor" + key: "php-composer-locked-php-8.4-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-composer-locked-php-8.3-" + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --prefer-dist" + + - name: "Run PHPUnit Tests" + run: "composer test-coverage" + + - name: "Run PHP CS Check" + run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check" + + - name: "Run PHPStan" + run: "composer analyze" + + - name: "Run Psalm" + run: "composer psalm" + + - name: "PHP Lint" + run: "composer lint" + + - name: "Run infection" run: "composer infection-ci" \ No newline at end of file diff --git a/composer.json b/composer.json index ddbb6cc..e49d551 100644 --- a/composer.json +++ b/composer.json @@ -45,10 +45,10 @@ "phpstan/phpstan-phpunit": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.3", "symfony/cache": "^6.3|^7.0", - "vimeo/psalm": "^5.23", - "psalm/plugin-laravel": "^2.10", + "vimeo/psalm": "^6.0", + "psalm/plugin-laravel": "^2.11", "psalm/plugin-phpunit": "^0.19", - "infection/infection": "^0.27.10", + "infection/infection": "^0.29.10", "laravel/framework": "^10.0|^v11.0" }, "scripts": { From 43fa20deb069d463a0e48c8b284b35f817229e13 Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Tue, 28 Jan 2025 20:01:23 +0100 Subject: [PATCH 6/7] Update infection/infection version constraint in composer.json Allow compatibility with both 0.27.10 and ^0.29.10 versions. This change ensures greater flexibility in dependency resolution while maintaining support for specific versions. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e49d551..79f67ea 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "vimeo/psalm": "^6.0", "psalm/plugin-laravel": "^2.11", "psalm/plugin-phpunit": "^0.19", - "infection/infection": "^0.29.10", + "infection/infection": "0.27.10|^0.29.10", "laravel/framework": "^10.0|^v11.0" }, "scripts": { From 05fd5cf3fd87ab77ea826f0fd58972a93d47d920 Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Tue, 28 Jan 2025 20:05:47 +0100 Subject: [PATCH 7/7] Update Psalm dependency to support version 5.x This change ensures compatibility with both Psalm 5.x and 6.x. It provides greater flexibility for projects that rely on older versions of Psalm while maintaining support for the latest version. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 79f67ea..9f66d95 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "phpstan/phpstan-phpunit": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.3", "symfony/cache": "^6.3|^7.0", - "vimeo/psalm": "^6.0", + "vimeo/psalm": "^5.0|^6.0", "psalm/plugin-laravel": "^2.11", "psalm/plugin-phpunit": "^0.19", "infection/infection": "0.27.10|^0.29.10",