mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 19:00:20 +02:00
Add baseline for php8.2
This commit is contained in:
1
.github/workflows/phpstan.yml
vendored
1
.github/workflows/phpstan.yml
vendored
@@ -17,6 +17,7 @@ jobs:
|
||||
matrix:
|
||||
php-version:
|
||||
- "8.1"
|
||||
- latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
6
phpstan-baseline-8.2.neon
Normal file
6
phpstan-baseline-8.2.neon
Normal file
@@ -0,0 +1,6 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Call to deprecated function utf8_encode\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Monolog/Utils.php
|
10
phpstan-ignore-by-php-version.neon.php
Normal file
10
phpstan-ignore-by-php-version.neon.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
$includes = [];
|
||||
if (PHP_VERSION_ID >= 80200) {
|
||||
$includes[] = __DIR__ . '/phpstan-baseline-8.2.neon';
|
||||
}
|
||||
|
||||
$config['includes'] = $includes;
|
||||
|
||||
return $config;
|
@@ -28,5 +28,6 @@ parameters:
|
||||
|
||||
includes:
|
||||
- phpstan-baseline.neon
|
||||
- phpstan-ignore-by-php-version.neon.php
|
||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||
|
@@ -200,8 +200,9 @@ final class Utils
|
||||
$data = preg_replace_callback(
|
||||
'/[\x80-\xFF]+/',
|
||||
function (array $m): string {
|
||||
// @phpstan-ignore function.deprecated
|
||||
return \function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]);
|
||||
return \function_exists('mb_convert_encoding')
|
||||
? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1')
|
||||
: (\function_exists('utf8_encode') ? utf8_encode($m[0]) : '');
|
||||
},
|
||||
$data
|
||||
);
|
||||
|
Reference in New Issue
Block a user