diff --git a/.github/workflows/bc.yml b/.github/workflows/bc.yml index f8cc5648..0ea4a5c1 100644 --- a/.github/workflows/bc.yml +++ b/.github/workflows/bc.yml @@ -30,4 +30,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.0'] + ['8.4'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e96052e5..68fac01f 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 5473ec96..632bfd48 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 a6873e2e..a56769ea 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 35411d0a..b2294456 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -20,4 +20,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.3'] + ['8.4'] diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index aea590ea..27126190 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -30,4 +30,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/CHANGELOG.md b/CHANGELOG.md index 4624f551..2a5b42e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 2.1.1 under development -- no changes in this release. +- Bug #123: Explicitly marking parameters as nullable (@Tigrov) +- Bug #123: Fix `ContextValueExtractor::extract()` with empty key in PHP 8.4 (@Tigrov) ## 2.1.0 July 03, 2024 diff --git a/composer.json b/composer.json index dc9a70b2..23d21c6a 100644 --- a/composer.json +++ b/composer.json @@ -36,11 +36,11 @@ }, "require-dev": { "maglnet/composer-require-checker": "^4.4", - "phpunit/phpunit": "^9.5", - "rector/rector": "^1.2", + "phpunit/phpunit": "^9.6", + "rector/rector": "^2.0", "roave/infection-static-analysis-plugin": "^1.18", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.30|^5.25" + "vimeo/psalm": "^4.30|^5.25|^6.0" }, "provide": { "psr/log-implementation": "1.0.0" diff --git a/psalm.xml b/psalm.xml index 95805489..5fb1e427 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,8 +1,10 @@ context; @@ -206,6 +206,7 @@ private function parse(string|Stringable $message, array $context): string { $message = (string) $message; + /** @var string */ return preg_replace_callback( '/{(.*)}/', static function (array $matches) use ($context) { diff --git a/src/Message/CategoryFilter.php b/src/Message/CategoryFilter.php index 1ec8013d..2271a975 100644 --- a/src/Message/CategoryFilter.php +++ b/src/Message/CategoryFilter.php @@ -5,7 +5,6 @@ namespace Yiisoft\Log\Message; use InvalidArgumentException; - use Yiisoft\Log\Message; use function is_string; diff --git a/src/Message/ContextValueExtractor.php b/src/Message/ContextValueExtractor.php index d7e11de8..6983af57 100644 --- a/src/Message/ContextValueExtractor.php +++ b/src/Message/ContextValueExtractor.php @@ -18,6 +18,7 @@ public static function extract(array $context, string $key): array $lastKey = array_pop($path); $array = $context; + foreach ($path as $pathItem) { $array = array_key_exists($pathItem, $array) ? $array[$pathItem] : null; if (!is_array($array)) { @@ -31,12 +32,12 @@ public static function extract(array $context, string $key): array } /** - * @psalm-return list + * @psalm-return non-empty-list */ private static function parsePath(string $path): array { if ($path === '') { - return []; + return ['']; } if (!str_contains($path, '.')) {