Skip to content

Commit f17a659

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

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎phpstan.neon.dist‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,20 @@ parameters:
88
scanFiles:
99
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
1010
treatPhpDocTypesAsCertain: false
11+
ignoreErrors:
12+
# johnbillion/wp-compat checks every WordPress symbol against the WordPress 4.9
13+
# baseline that wp-cli-tests configures. It only recognizes function_exists() and
14+
# method_exists() guards, so it cannot see the `before_invoke` check in
15+
# ai-command.php that aborts `wp ai` and `wp connectors` below WordPress 7.0.
16+
#
17+
# The entries below match on the message as well as the identifier, naming both the
18+
# functions and that version, so a call to anything introduced after 7.0 still gets
19+
# reported rather than swallowed by a file-wide ignore.
20+
-
21+
identifier: WPCompat.functionNotAvailable
22+
message: '#^(wp_ai_client_prompt|wp_supports_ai)\(\) is only available since WordPress version 7\.0\.0\.$#'
23+
path: src/AI_Command.php
24+
-
25+
identifier: WPCompat.functionNotAvailable
26+
message: '#^(wp_get_connector|wp_get_connectors)\(\) is only available since WordPress version 7\.0\.0\.$#'
27+
path: src/Connectors_Command.php

0 commit comments

Comments
 (0)