Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Oct 7, 2025

@staabm staabm marked this pull request as ready for review October 7, 2025 08:06
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

throw new \RuntimeException('Absolute URLs are prohibited for the redirectTo parameter.');
}

assertType('array{scheme?: string, host?: string, port?: int<0, 65535>, user?: string, pass?: string, path?: string, query?: string, fragment?: string}', $parsedUrl);
Copy link
Contributor Author

@staabm staabm Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case we got more preicse, because we no longer have a union array{...}|false but just the plain array-shape.
but on the other hand we no longer know that the 'host' offset cannot exist at this point.

I tried several variants, but wasn't successfull in combining the specified types in a way which turns the mixed into array while also removing the offset.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it out

@staabm staabm force-pushed the arr-key branch 4 times, most recently from e479f0e to cebec02 Compare October 12, 2025 07:49
@staabm
Copy link
Contributor Author

staabm commented Oct 12, 2025

Memo for me: add test for the issue-bot report

Edit: ✅

@ondrejmirtes ondrejmirtes merged commit bab0af7 into phpstan:2.1.x Oct 16, 2025
541 of 551 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

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.

!array_key_exists() should imply array for PHP8+ Creating new array on mixed[] should be allowed if key does not exist.

3 participants