From 7abd56c47fa034b39c0ffde415cd3979573dd35f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 21:04:40 +0100 Subject: [PATCH] Add support for PHP 8.4 (#29) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathan Boiron --- .github/workflows/run-tests.yml | 3 +-- Makefile | 4 ---- composer.json | 2 +- src/MagicConstant.php | 4 ++-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f47af6f..30c0847 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.2, 8.3 ] + php: [ 8.2, 8.3, 8.4 ] dependency-version: [ prefer-lowest, prefer-stable ] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -22,7 +22,6 @@ jobs: with: php-version: ${{ matrix.php }} coverage: none - tools: composer:v2 - name: Cache dependencies uses: actions/cache@v4 diff --git a/Makefile b/Makefile index f580e23..a7decbe 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,3 @@ coverage: ## to perform unit tests with code coverage. .PHONY: phpstan phpstan: ## to run PHPStan php vendor/bin/phpstan analyse - -.PHONY: infection -infection: ## to run Infection - php vendor/bin/infection --threads=max diff --git a/composer.json b/composer.json index 859126c..0f22a68 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ } ], "require": { - "php": "8.2.* || 8.3.*" + "php": "8.2.* || 8.3.* || 8.4.*" }, "autoload": { "psr-4": { diff --git a/src/MagicConstant.php b/src/MagicConstant.php index f00192c..ee60b71 100644 --- a/src/MagicConstant.php +++ b/src/MagicConstant.php @@ -27,7 +27,7 @@ final public function __construct(mixed $value) $this->setValue($value); } - public function getValue(string|int $format = null): mixed + public function getValue(string|int|null $format = null): mixed { if (empty($format)) { return $this->value; @@ -163,7 +163,7 @@ public static function keys(): array /** * @return static[] */ - public static function values(string $pattern = null): array + public static function values(?string $pattern = null): array { $out = [];