From 48e332694a7b5f4471dbf95b1e2c5c69683aed7a Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 13 Feb 2025 10:26:47 +0300 Subject: [PATCH 1/5] bump PHP version --- .github/workflows/build.yml | 2 +- .../workflows/composer-require-checker.yml | 2 +- .github/workflows/mutation.yml | 2 +- .github/workflows/rector.yml | 2 +- .github/workflows/static.yml | 2 +- CHANGELOG.md | 2 +- composer.json | 19 ++++++++++--------- rector.php | 18 ++++++------------ 8 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e96052e..68fac01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.0', '8.1', '8.2', '8.3'] + ['8.0', '8.1', '8.2', '8.3', '8.4'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index 5473ec9..632bfd4 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.0', '8.1', '8.2', '8.3'] + ['8.0', '8.1', '8.2', '8.3', '8.4'] diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index a6873e2..a56769e 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -27,6 +27,6 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.3'] + ['8.4'] secrets: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 457772a..5d6931d 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -21,4 +21,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.3'] + ['8.4'] diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index e34190e..14d169f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -29,7 +29,7 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['8.1', '8.2', '8.3', '8.4'] psalm80: uses: yiisoft/actions/.github/workflows/psalm.yml@master with: diff --git a/CHANGELOG.md b/CHANGELOG.md index a42ccaa..cbe5e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.2.1 under development -- no changes in this release. +- Chg #90: Change PHP constraint in `composer.json` to `~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik) ## 3.2.0 January 13, 2025 diff --git a/composer.json b/composer.json index 31e6c08..a503fe8 100644 --- a/composer.json +++ b/composer.json @@ -30,19 +30,19 @@ } ], "require": { - "php": "^8.0", - "psr/simple-cache": "^2.0|^3.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "psr/simple-cache": "^2.0 || ^3.0" }, "require-dev": { "maglnet/composer-require-checker": "^4.4", - "php-mock/php-mock-phpunit": "^2.6", - "phpunit/phpunit": "^9.5", - "rector/rector": "^2.0", - "roave/infection-static-analysis-plugin": "^1.16", - "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.30|^5.21", + "php-mock/php-mock-phpunit": "^2.10", + "phpunit/phpunit": "^9.6.22", + "rector/rector": "^2.0.9", + "roave/infection-static-analysis-plugin": "^1.25", + "spatie/phpunit-watcher": "^1.23.6", + "vimeo/psalm": "^4.30 || ^5.21 || ^6.5.1", "yiisoft/aliases": "^3.0", - "yiisoft/di": "^1.2" + "yiisoft/di": "^1.2.1" }, "autoload": { "psr-4": { @@ -68,6 +68,7 @@ }, "config": { "sort-packages": true, + "bump-after-update": "dev", "allow-plugins": { "infection/extension-installer": true, "composer/package-versions-deprecated": true diff --git a/rector.php b/rector.php index 63713ce..32c8e91 100644 --- a/rector.php +++ b/rector.php @@ -4,19 +4,13 @@ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\LevelSetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', + ]) + ->withPhpSets(php80: true) + ->withRules([ + InlineConstructorDefaultToPropertyRector::class, ]); - - // register a single rule - $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); - - // define sets of rules - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_80, - ]); -}; From 9bc54836425fef62f21a3fd59c3ff5e0e17f0b7b Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 14 Feb 2025 14:34:51 +0300 Subject: [PATCH 2/5] fix --- CHANGELOG.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30963cc..7d857b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 3.2.1 under development -- Chg #90: Change PHP constraint in `composer.json` to `~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik) +- Chg #91: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik) - Сhg #90: Bump minimal required PHP version to 8.1 and minor refactoring (@vjik) ## 3.2.0 January 13, 2025 diff --git a/README.md b/README.md index 1a66f35..02168f9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This package implements file-based [PSR-16](https://www.php-fig.org/psr/psr-16/) ## Requirements -- PHP 8.0 or higher. +- PHP 8.1 or higher. ## Installation From ffb90c3bc89ad483b2a8c19aae2f5e7450d624f7 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 14 Feb 2025 14:47:03 +0300 Subject: [PATCH 3/5] fix --- src/FileCache.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FileCache.php b/src/FileCache.php index e65619d..14705f1 100644 --- a/src/FileCache.php +++ b/src/FileCache.php @@ -106,6 +106,9 @@ public function get(string $key, mixed $default = null): mixed } flock($filePointer, LOCK_SH); + /** + * @var string $value We assume that we always cam read content from `$filePointer` resource. + */ $value = stream_get_contents($filePointer); flock($filePointer, LOCK_UN); fclose($filePointer); From 43c7cc7245e7d1cbaf9cd3fda3f2840f61c20ebb Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 14 Feb 2025 14:50:23 +0300 Subject: [PATCH 4/5] improve --- CHANGELOG.md | 2 +- src/FileCache.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d857b4..914648d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 3.2.1 under development - Chg #91: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik) -- Сhg #90: Bump minimal required PHP version to 8.1 and minor refactoring (@vjik) +- Сhg #90, #91: Bump minimal required PHP version to 8.1 and minor refactoring (@vjik) ## 3.2.0 January 13, 2025 diff --git a/src/FileCache.php b/src/FileCache.php index 14705f1..fef719b 100644 --- a/src/FileCache.php +++ b/src/FileCache.php @@ -91,7 +91,7 @@ final class FileCache implements CacheInterface * @throws CacheException If failed to create cache directory. */ public function __construct( - private string $cachePath, + private readonly string $cachePath, private int $directoryMode = 0775, ) { } From 6ccfdfe18bff52bf0ceb1871805b1472d133b2d1 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Fri, 14 Feb 2025 17:29:11 +0300 Subject: [PATCH 5/5] Update src/FileCache.php Co-authored-by: Alexander Makarov --- src/FileCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileCache.php b/src/FileCache.php index fef719b..b866638 100644 --- a/src/FileCache.php +++ b/src/FileCache.php @@ -107,7 +107,7 @@ public function get(string $key, mixed $default = null): mixed flock($filePointer, LOCK_SH); /** - * @var string $value We assume that we always cam read content from `$filePointer` resource. + * @var string $value We assume that we always can read content from `$filePointer` resource. */ $value = stream_get_contents($filePointer); flock($filePointer, LOCK_UN);