Skip to content

Use the PHP_URL_* wildcard in the wp_parse_url stub again - #67

Merged
danog merged 1 commit into
psalm:masterfrom
danog:php-url-wildcard
Oct 20, 2026
Merged

danog merged 1 commit into
psalm:masterfrom
danog:php-url-wildcard

Conversation

@danog

@danog danog commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

The wp_parse_url stub spells PHP_URL_* out as 0|1|2|3|4|5|6|7 because Psalm 7 rejected global constant wildcards; this needs vimeo/psalm#12419 (Psalm dev-master), so it should be merged after it.

Before:

/**
 * @template TComponent of (-1|0|1|2|3|4|5|6|7)
 * @param string $url
 * @param TComponent $component
 */
function wp_parse_url( string $url, int $component = -1 ) {}

wp_parse_url( $url, PHP_URL_HOST ); // false|null|string

After:

/**
 * @template TComponent of (-1|PHP_URL_*)
 * @param string $url
 * @param TComponent $component
 */
function wp_parse_url( string $url, int $component = -1 ) {}

wp_parse_url( $url, PHP_URL_HOST ); // false|null|string

https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW

@danog
danog marked this pull request as draft October 20, 2026 09:46
@danog
danog marked this pull request as ready for review October 20, 2026 13:17
@danog
danog merged commit e2a657a into psalm:master Oct 20, 2026
3 of 6 checks passed
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.

1 participant