Skip to content

Commit 1f36691

Browse files
committed
Move to php-stubs/wordpress-stubs, new ignores
1 parent 0204629 commit 1f36691

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
"license": "MIT",
66
"require": {
77
"php": "~7.1",
8-
"giacocorsiglia/wordpress-stubs": "^5.1",
9-
"phpstan/phpstan": "^0.11.5"
8+
"phpstan/phpstan": "^0.11.8",
9+
"php-stubs/wordpress-stubs": "^4.7 || ^5.0",
10+
"symfony/polyfill-php73": "^1.12.0"
1011
},
1112
"require-dev": {
1213
"composer/composer": "^1.8.6",

example/phpstan.neon.dist

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# Start command: composer update --classmap-authoritative && vendor/bin/phpstan analyze
1+
#$ composer update --optimize-autoloader
2+
#$ sed -e 's#^function is_countable(#// &#' -i vendor/giacocorsiglia/wordpress-stubs/wordpress-stubs.php
3+
#$ vendor/bin/phpstan analyze
24

35
includes:
4-
# https://github.com/phpstan/phpstan/blob/master/conf/bleedingEdge.neon
5-
# - vendor/phpstan/phpstan/conf/bleedingEdge.neon
6+
# @see https://github.com/phpstan/phpstan/blob/master/conf/bleedingEdge.neon
7+
# Regular phpstan installation
8+
#- vendor/phpstan/phpstan/conf/bleedingEdge.neon
9+
# PHAR installation
610
- phar://phpstan.phar/conf/bleedingEdge.neon
11+
# Include this extension
712
- vendor/szepeviktor/phpstan-wordpress/extension.neon
813
parameters:
914
level: max
@@ -22,14 +27,15 @@ parameters:
2227
# - %currentWorkingDirectory%/inc/
2328
ignoreErrors:
2429
# Uses func_get_args()
25-
- '#^Function apply_filters invoked with [34567] parameters, 2 required\.$#'
26-
- '#^Function do_action invoked with [3456] parameters, 1-2 required\.$#'
30+
- '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#'
31+
- '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#'
2732
- '#^Function current_user_can invoked with 2 parameters, 1 required\.$#'
2833
- '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#'
29-
- '#^Function add_theme_support invoked with [2345] parameters, 1 required\.$#'
3034
- '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#'
35+
- '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#'
36+
- '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#'
3137
# https://core.trac.wordpress.org/ticket/43304
3238
- '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/'
3339
# WP-CLI accepts a class as callable
3440
- '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/'
35-
# Please consider commenting ignores: issue URL or reason of ignore
41+
# Please consider commenting ignores: issue URL or reason for ignoring

extension.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
- phpstan.broker.dynamicFunctionReturnTypeExtension
2222
parameters:
2323
autoload_files:
24-
- %rootDir%/../../giacocorsiglia/wordpress-stubs/wordpress-stubs.php
24+
- %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
2525
- %rootDir%/../../szepeviktor/phpstan-wordpress/bootstrap.php
2626
dynamicConstantNames:
2727
- WP_DEBUG

0 commit comments

Comments
 (0)