-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
57 lines (56 loc) · 2.1 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
57 lines (56 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
parameters:
# Rules
treatPhpDocTypesAsCertain: false
inferPrivatePropertyTypeFromConstructor: true
checkExplicitMixedMissingReturn: true
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
checkTooWideReturnTypesInProtectedAndPublicMethods: true
polluteScopeWithAlwaysIterableForeach: false
polluteScopeWithLoopInitialAssignments: false
reportAlwaysTrueInLastCondition: true
reportStaticMethodSignatures: true
reportWrongPhpDocTypeInVarTag: true
# Configuration
level: 5
phpVersion:
min: 70400
max: 80400
bootstrapFiles:
- classifai.php
paths:
- classifai.php
- config.php
- includes/
scanFiles:
- vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php
- vendor/php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php
- vendor/php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php
- vendor/php-stubs/wp-cli-stubs/wp-cli-tools-stubs.php
# These are needed due config.platform.php being 7.4 in composer.json and wordpress-stubs not including polyfills.
# See <https://github.com/php-stubs/wordpress-stubs/issues/100>.
- vendor/phpstan/php-8-stubs/stubs/ext/standard/str_contains.php
- vendor/phpstan/php-8-stubs/stubs/ext/standard/str_starts_with.php
scanDirectories:
# These libraries are loaded lazily at runtime (not via Composer autoload),
# so PHPStan needs them scanned explicitly to discover their symbols.
- vendor/woocommerce/action-scheduler/classes
- vendor/yahnis-elsts/plugin-update-checker/Puc
ignoreErrors:
# The JSDoc standard we use on hooks is not compatible with PHPStan.
# These hook docblocks use tokens such as `$this`, `$this->prop` and `{array}`
# that PHPStan's PHPDoc parser cannot tokenize.
- '#One or more @param tags has an invalid name or invalid syntax#'
- '#@param tag must not be named \$this. Choose a descriptive alias, for example \$instance#'
- '#PHPDoc tag @(param|return|var) has invalid value (.*): Unexpected token#s'
# Ignore ElasticPress for now, as we'll need to stub this.
- '#ElasticPress#'
excludePaths:
analyse:
- tests/
- vendor/
- vendor-prefixed/
analyseAndScan:
- node_modules (?)
WPCompat:
requiresAtLeast: '6.9'