diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 114a9484f5659..b9f9aad6bac74 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -7595,6 +7595,8 @@ function _device_can_upload() { * * @param string $path The resource path or URL. * @return bool True if the path is a stream URL. + * + * @phpstan-assert-if-true =non-falsy-string $path */ function wp_is_stream( $path ) { $scheme_separator = strpos( $path, '://' ); @@ -8227,6 +8229,7 @@ function wp_generate_uuid4() { * to accept any UUID version. Otherwise, only version allowed is `4`. * @return bool The string is a valid UUID or false on failure. * + * @phpstan-assert-if-true =lowercase-string&non-falsy-string $uuid * @phpstan-return ( $version is 4|null ? bool : false ) */ function wp_is_uuid( $uuid, $version = null ) { diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php index bd5f74a1ec17b..d6bb8db1e6b91 100644 --- a/src/wp-includes/shortcodes.php +++ b/src/wp-includes/shortcodes.php @@ -131,6 +131,8 @@ function remove_all_shortcodes() { * * @param string $tag Shortcode tag to check. * @return bool Whether the given shortcode exists. + * + * @phpstan-assert-if-true =non-empty-string $tag */ function shortcode_exists( $tag ) { global $shortcode_tags; @@ -148,6 +150,8 @@ function shortcode_exists( $tag ) { * @param string $tag Shortcode tag to check. * @return bool Whether the passed content contains the given shortcode. * + * @phpstan-assert-if-true =non-falsy-string $content + * @phpstan-assert-if-true =non-empty-string $tag * @phpstan-return ( $tag is '' ? false : ( $content is empty ? false : bool ) ) */ function has_shortcode( $content, $tag ) { diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index ea13e99271cf0..e0f3c4ed8fb1a 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -375,6 +375,7 @@ function get_taxonomy( $taxonomy ) { * @param string $taxonomy Name of taxonomy object. * @return bool Whether the taxonomy exists. * + * @phpstan-assert-if-true =non-falsy-string $taxonomy * @phpstan-return ( $taxonomy is non-falsy-string ? bool : false ) */ function taxonomy_exists( $taxonomy ) {