From 85d4e49b8660ac553a97b0d0aff097bd4be4f9dc Mon Sep 17 00:00:00 2001 From: Marcel Strahl Date: Sat, 7 Dec 2024 00:29:43 +0100 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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; }