Repository navigation
Expand file tree
/
Copy pathphpstan.neon
More file actions
40 lines (39 loc) · 2.01 KB
/
Copy pathphpstan.neon
File metadata and controls
40 lines (39 loc) · 2.01 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
includes:
- phpstan-baseline.neon
- vendor/pollora/harness/presets/phpstan/base.neon
parameters:
level: 5
paths:
- src
excludePaths:
- vendor/*
# WordPress function doubles: analysing them makes PHPStan treat the real functions as side-effect free
- tests/Helpers/*
ignoreErrors:
# WordPress function mocks in tests
- '#Function [a-zA-Z0-9\\_]+ not found#'
- '#Call to undefined function [a-zA-Z0-9\\_]+#'
# Mockery related errors
- '#Parameter \#\d+ \$[a-zA-Z0-9_]+ of class [^]]+ constructor expects [^,]+, Mockery\\(MockInterface|LegacyMockInterface)(\|[^,]+)* given.#'
- '#Call to an undefined method Mockery\\ExpectationInterface\|Mockery\\HigherOrderMessage::[a-zA-Z0-9_]+\(\).#'
# Traits property access errors
- '#Access to an undefined property Pollora\\Entity\\Traits\\Entity::\$[a-zA-Z0-9_]+.#'
# WP specific classes
- '#(has invalid type|has unknown class) WP_REST_Controller#'
- '#Method .+::getRestController\(\) has invalid return type WP_REST_Controller.#'
# Null coalescence operator checks
- '#Expression on left side of \?\? is not nullable.#'
- '#Property .+ on left side of \?\? is not nullable.#'
# Unsafe usage of new static() - this is a valid pattern in this codebase
- '#Unsafe usage of new static\(\).#'
# Method returns in constructor - Legacy code
- '#Method .+::__construct\(\) with return type void returns .+ but should not return anything.#'
# Undefined methods in legacy code
- '#Call to an undefined method Pollora\\Entity\\(PostType|Taxonomy)::(init|registerEntityType)\(\).#'
# Properties only written, never read
- '#Property .+::\$[a-zA-Z0-9_]+ is never read, only written.#'
# PHPDoc issues
- '#PHPDoc tag @param references unknown parameter: \$[a-zA-Z0-9_]+#'
# Pest.php issues
- '#Undefined variable: \$this#'
reportUnmatchedIgnoredErrors: false