Skip to content

Commit

Permalink
Trick psalm & phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
ebln committed Jun 2, 2024
1 parent bb3d1ce commit 87664e2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions phpstan-baseline-7.4.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
ignoreErrors:
-
message: "#^Call to an undefined method ReflectionClass\\:\\:getAttributes\\(\\)\\.$#"
path: src/ForceFactoryRule.php

-
message: "#^Method Ebln\\\\PHPStan\\\\EnforceFactory\\\\ForceFactoryRule\\:\\:getFactoriesFromAttributeByClass\\(\\) has parameter \\$reflection with generic class ReflectionClass but does not specify its types\\: T$#"
path: src/ForceFactoryRule.php

-
message: "#^PHPDoc tag @param for parameter \\$reflection with type PHPStan\\\\BetterReflection\\\\Reflection\\\\Adapter\\\\ReflectionClass\\|PHPStan\\\\BetterReflection\\\\Reflection\\\\Adapter\\\\ReflectionEnum is not subtype of native type ReflectionClass\\.$#"
path: src/ForceFactoryRule.php
14 changes: 14 additions & 0 deletions phpstan-ignore-by-version.neon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

$includes = [];
if (PHP_VERSION_ID <= 80000) {
$includes[] = __DIR__ . '/phpstan-baseline-7.4.neon';
}

$config = [];
$config['includes'] = $includes;
$config['parameters']['phpVersion'] = PHP_VERSION_ID;

return $config;
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
includes:
- phpstan-ignore-by-version.neon.php

parameters:
level: max
paths:
Expand Down

0 comments on commit 87664e2

Please sign in to comment.