Skip to content
5 changes: 4 additions & 1 deletion src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2149,8 +2149,8 @@ function wp_mkdir_p( $target ) {
* @param string $path File path.
* @return bool True if path is absolute, false is not absolute.
*
* @phpstan-assert-if-true =non-falsy-string $path
* @phpstan-return ( $path is non-falsy-string ? bool : false )
* @phpstan-assert-if-true non-falsy-string $path
*/
function path_is_absolute( $path ) {
/*
Expand Down Expand Up @@ -7597,6 +7597,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, '://' );
Expand Down Expand Up @@ -8229,6 +8231,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 ) {
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ) {
Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
Loading