Skip to content

Commit 3dcb4c3

Browse files
committedOct 7, 2020
default phpstan config file
1 parent 72a8df0 commit 3dcb4c3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
 

‎codeat-phpstan.neon

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
includes:
3+
- /home/mte90/.composer/vendor/szepeviktor/phpstan-wordpress/extension.neon
4+
parameters:
5+
level: max
6+
inferPrivatePropertyTypeFromConstructor: true
7+
# Void as typehints are available only on PHP 7.1+
8+
checkMissingIterableValueType: false
9+
paths:
10+
- ./
11+
excludes_analyse:
12+
- vendor/
13+
- tests/
14+
ignoreErrors:
15+
# Void as typehints are available only on PHP 7.1+
16+
- '#has no return typehint specified\.$#'
17+
# In wp_count_posts(): $counts = (object) $counts;
18+
- '#^Access to an undefined property object::\$pending\.$#'
19+
# AMP plugin stubs can be also generated
20+
- '#^Function is_amp_endpoint not found\.$#'
21+
# PHPStan is better safe than sorry!
22+
# https://github.com/phpstan/phpstan/issues/1060#issuecomment-667675767
23+
- '#^Argument of an invalid type object supplied for foreach, only iterables are supported\.$#'
24+
# https://github.com/WPBP/WordPress-Plugin-Boilerplate-Powered/issues/162
25+
- '#^Parameter \#2 \$object_id of function cmb2_metabox_form expects int, string given\.$#'
26+
# TODO Any can POST an array in a $_POST item, May I send a PR?
27+
- '#^Parameter \#1 \$str of function sanitize_text_field expects string, array<string>\|string given\.$#'

0 commit comments

Comments
 (0)