Skip to content

Commit 3e44cdb

Browse files
swissspidyclaude
andauthored
Exclude the wp-compat false positives from the PHPStan config (#12)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7ce09c6 commit 3e44cdb

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎phpstan.neon.dist‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,26 @@ parameters:
2727
-
2828
message: '#Cannot access offset string on mixed#'
2929
reportUnmatched: false
30+
31+
# johnbillion/wp-compat checks every WordPress symbol against the WordPress 4.9
32+
# baseline that wp-cli-tests configures. It only recognizes function_exists() and
33+
# method_exists() guards, so it cannot see the `before_invoke` check in
34+
# ability-command.php that aborts every `wp ability` command below WordPress 6.9.
35+
#
36+
# The entries below match on the message as well as the identifier, naming both the
37+
# symbols and that version, so a call to anything introduced after 6.9 still gets
38+
# reported rather than swallowed by a file-wide ignore.
39+
-
40+
identifier: WPCompat.functionNotAvailable
41+
message: '#^(wp_get_abilities|wp_get_ability|wp_get_ability_categories|wp_get_ability_category|wp_has_ability|wp_has_ability_category)\(\) is only available since WordPress version 6\.9\.0\.$#'
42+
paths:
43+
- src/Ability_Command.php
44+
- src/Ability_Category_Command.php
45+
-
46+
identifier: WPCompat.methodNotAvailable
47+
message: '#^WP_Ability::(check_permissions|execute|get_category|get_description|get_input_schema|get_label|get_meta|get_meta_item|get_name|get_output_schema|normalize_input|validate_input)\(\) is only available since WordPress version 6\.9\.0\.$#'
48+
path: src/Ability_Command.php
49+
-
50+
identifier: WPCompat.methodNotAvailable
51+
message: '#^WP_Ability_Category::(get_description|get_label|get_meta|get_slug)\(\) is only available since WordPress version 6\.9\.0\.$#'
52+
path: src/Ability_Category_Command.php

0 commit comments

Comments
 (0)