diff --git a/README.md b/README.md index 335245e..52b728f 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,10 @@ parameters: bootstrapFiles: - vendor/wpsyntex/polylang-stubs/polylang-stubs.php ``` + +Opt-in for WordPress stubs override. + +```yaml + stubFiles: + - vendor/wpsyntex/polylang-phpstan/stubs/wordpress-override.php +``` diff --git a/stubs/wordpress-override.php b/stubs/wordpress-override.php new file mode 100644 index 0000000..b9ebcf6 --- /dev/null +++ b/stubs/wordpress-override.php @@ -0,0 +1,24 @@ +|object $data + * @return scalar + */ +function maybe_serialize( $data ) {} + +/** + * Accepts anything and returns a string. @see {_sanitize_text_field()}. + * + * @param mixed $str + * @return string + */ +function sanitize_text_field( $str ) {}