Skip to content

Commit 8b20de1

Browse files
swissspidyclaude
andauthored
Exclude the wp-compat false positives from the PHPStan config (#256)
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 596da16 commit 8b20de1

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎phpstan.neon.dist‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,31 @@ parameters:
1010
treatPhpDocTypesAsCertain: false
1111
ignoreErrors:
1212
- identifier: missingType.iterableValue
13+
14+
# johnbillion/wp-compat checks every WordPress symbol against the WordPress 4.9
15+
# baseline that wp-cli-tests configures. It only recognizes function_exists() and
16+
# method_exists() guards, so it cannot see the `wp_version_compare()` checks used
17+
# throughout this command.
18+
19+
# WordPress 6.0 only formalized the already documented `...$args` parameter of
20+
# `apply_filters()` by adding it to the function signature. Additional arguments
21+
# were collected through `func_get_args()` before that. The two
22+
# `intermediate_image_sizes_advanced` calls are already split across a
23+
# `wp_version_compare()` check for exactly this reason.
24+
-
25+
identifier: WPCompat.parameterNotAvailable.applyfilters.args
26+
path: src/Media_Command.php
27+
28+
# The WordPress 6.0 change to `wp_generate_attachment_metadata()` added the
29+
# `$filesize` value to the *returned array*. The `$file` parameter itself has been
30+
# there since WordPress 2.1.
31+
-
32+
identifier: WPCompat.parameterNotAvailable.wpgenerateattachmentmetadata.file
33+
path: src/Media_Command.php
34+
35+
# `Media_Command::wp_get_registered_image_subsizes()` only calls its WordPress 5.3
36+
# namesake behind a `wp_version_compare()` check, and reimplements it otherwise.
37+
-
38+
identifier: WPCompat.functionNotAvailable
39+
message: '#^wp_get_registered_image_subsizes\(\) is only available since WordPress version 5\.3\.0\.$#'
40+
path: src/Media_Command.php

0 commit comments

Comments
 (0)