Exclude new PHPStan level 6 for now

[MAILPOET-2588]
This commit is contained in:
Jan Jakeš
2019-12-19 13:53:59 +01:00
committed by amine-mp
parent ff7c63f0b3
commit d44fef7528
3 changed files with 16 additions and 1 deletions

View File

@@ -475,7 +475,6 @@ class RoboFile extends \Robo\Tasks {
'WP_ROOT="' . getenv('WP_ROOT') . '"',
'php -d memory_limit=2G',
"$dir/tasks/phpstan/vendor/bin/phpstan analyse ",
'--level 7',
]);
// PHPStan must be run out of main plugin directory to avoid its autoloading

View File

@@ -1,4 +1,5 @@
parameters:
level: 8
tmpDir: ../../temp/phpstan
bootstrap: bootstrap.php
autoload_files:
@@ -15,9 +16,16 @@ parameters:
- WP_DEBUG
ignoreErrors:
- '/Parameter #1 $cssOrXPath of method AcceptanceTester::moveMouseOver() expects string|null, array<string, string> given./'
- '/(with|has) no (return )?typehint specified/' # exclude level 6 errors
excludes_analyse:
- ../../tests/_support/_generated
# exclude level 6 errors
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
checkMissingVarTagTypehint: false
checkMissingTypehints: false
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- extensions/PHPUnit5CompatExtension/extension.neon

View File

@@ -1,4 +1,5 @@
parameters:
level: 8
tmpDir: ../../temp/phpstan
bootstrap: bootstrap.php
inferPrivatePropertyTypeFromConstructor: true
@@ -13,9 +14,16 @@ parameters:
- '#Parameter \#2 \$prefix of function http_build_query expects string, null given.#'
- '#Parameter \#1 \$function of function call_user_func_array expects callable(): mixed, .wc_.*. given.#'
- '#Parameter \#1 \$reader of class MailPoetVendor\\Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver constructor expects MailPoetVendor\\Doctrine\\Common\\Annotations\\AnnotationReader, MailPoetVendor\\Doctrine\\Common\\Annotations\\CachedReader given#'
- '/(with|has) no (return )?typehint specified/' # exclude level 6 errors
reportUnmatchedIgnoredErrors: false
dynamicConstantNames:
- WP_DEBUG
- MAILPOET_PREMIUM_INITIALIZED
# exclude level 6 errors
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
checkMissingVarTagTypehint: false
checkMissingTypehints: false
includes:
- phpstan-baseline.neon # https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff