mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 19:57:41 +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:
|
matrix:
|
||||||
php-version:
|
php-version:
|
||||||
- "8.1"
|
- "8.1"
|
||||||
|
- latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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:
|
includes:
|
||||||
- phpstan-baseline.neon
|
- phpstan-baseline.neon
|
||||||
|
- phpstan-ignore-by-php-version.neon.php
|
||||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||||
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||||
|
@@ -200,8 +200,9 @@ final class Utils
|
|||||||
$data = preg_replace_callback(
|
$data = preg_replace_callback(
|
||||||
'/[\x80-\xFF]+/',
|
'/[\x80-\xFF]+/',
|
||||||
function (array $m): string {
|
function (array $m): string {
|
||||||
// @phpstan-ignore function.deprecated
|
return \function_exists('mb_convert_encoding')
|
||||||
return \function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]);
|
? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1')
|
||||||
|
: (\function_exists('utf8_encode') ? utf8_encode($m[0]) : '');
|
||||||
},
|
},
|
||||||
$data
|
$data
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user