Skip to content

Commit 853ca73

Browse files
committed
Ignore PHPStan's ClassReflection::isEnum error when analyzing the extension code on PHP 7.4
The error is unintentional and maybe it will be resolved soon, but until then let's ignore it. See phpstan/phpstan#12888
1 parent 1c5e699 commit 853ca73

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

phpstan-ignore-errors.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
$config = [
5+
'parameters' => [
6+
'ignoreErrors' => [],
7+
]
8+
];
9+
10+
if (PHP_VERSION_ID < 80000) {
11+
// https://github.com/phpstan/phpstan/discussions/12888
12+
$config['parameters']['ignoreErrors'][] = [
13+
'message' => '#^Call to method PHPStan\\\\Reflection\\\\ClassReflection::isEnum\\(\\) will always evaluate to false\\.$#',
14+
'reportUnmatched' => false,
15+
];
16+
}
17+
18+
return $config;

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ parameters:
1717
- src/PHPStan1Compatibility.php
1818

1919
includes:
20+
- phpstan-ignore-errors.php
2021
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
2122
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
2223
- extension.neon

0 commit comments

Comments
 (0)