diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e7b40..3584e6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['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 a857bce..a93390b 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.1', '8.2', '8.3'] + ['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 e33eca8..d03874d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -29,4 +29,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2', '8.3'] + ['8.1', '8.2', '8.3', '8.4'] diff --git a/CHANGELOG.md b/CHANGELOG.md index d2870f0..914648d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 3.2.1 under development -- Сhg #90: Bump minimal required PHP version to 8.1 and minor refactoring (@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, #91: 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 diff --git a/composer.json b/composer.json index 26001dc..e17170a 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ } ], "require": { - "php": "^8.1", - "psr/simple-cache": "^2.0|^3.0" + "php": "~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.7.1", @@ -40,7 +40,7 @@ "rector/rector": "^2.0.9", "roave/infection-static-analysis-plugin": "^1.35", "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1", + "vimeo/psalm": "^5.21 || ^6.5.1", "yiisoft/aliases": "^3.0", "yiisoft/di": "^1.3" }, diff --git a/src/FileCache.php b/src/FileCache.php index e65619d..b866638 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, ) { } @@ -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 can read content from `$filePointer` resource. + */ $value = stream_get_contents($filePointer); flock($filePointer, LOCK_UN); fclose($filePointer);