Skip to content

wp_is_stream: assert non-falsy $path - #489

Merged
szepeviktor merged 2 commits into
php-stubs:masterfrom
IanDelMar:stream
Sep 3, 2026
Merged

wp_is_stream: assert non-falsy $path#489
szepeviktor merged 2 commits into
php-stubs:masterfrom
IanDelMar:stream

Conversation

@IanDelMar

@IanDelMar IanDelMar commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

If wp_is_stream($path) returns true, $path is a non-falsy-string; however, there is no corresponding narrowing on the false branch.

Given

$scheme_separator = strpos( $path, '://' );

if ( false === $scheme_separator ) {
	// $path isn't a stream.
	return false;
}

from the WP function reference, any falsy string necessarily causes the function to return false.

@szepeviktor
szepeviktor merged commit c744761 into php-stubs:master Sep 3, 2026
8 checks passed
@IanDelMar
IanDelMar deleted the stream branch September 3, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants