Skip to content

Comments

Narrow return type of wp_extract_urls#293

Merged
szepeviktor merged 1 commit intophp-stubs:masterfrom
IanDelMar:wp_extract_urls
Jul 28, 2025
Merged

Narrow return type of wp_extract_urls#293
szepeviktor merged 1 commit intophp-stubs:masterfrom
IanDelMar:wp_extract_urls

Conversation

@IanDelMar
Copy link
Contributor

Narrows the return type of wp_extract_urls() from string[] to array{}|list<string>. Does not handle the number of found urls in non empty $content strings.

@szepeviktor
Copy link
Member

Ian strikes again!

@szepeviktor szepeviktor merged commit 1ce8886 into php-stubs:master Jul 28, 2025
6 checks passed
@szepeviktor
Copy link
Member

🎈 Does list<string> include an empty array??

@IanDelMar
Copy link
Contributor Author

🎈 Does list<string> include an empty array??

Yes. Otherwise, it would be a non-empty-list<string> (example at phpstan.org/try).

@IanDelMar IanDelMar deleted the wp_extract_urls branch July 28, 2025 11:59
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