Skip to content

Conversation

VincentLanglet
Copy link
Contributor

Since Type results are cached, I had to duplicate them two handle the case if the string is or not a lowercase-string.

Since some part of an url are not case sensitive, it might be useful to keep the lowercase-string accessory on it.
I have multiple example in my work codebase where we're doing

$url = strtolower($url); // lowercase-string

// Some manipulation on the URL which keeps the `lowercase-string` status (like trimming)

$host = parse_url($url, PHP_URL_HOST); // I expect to keep the lowercase-string

$this->manipulateHost($host); // `manipulateHost` require a lowercase-string

@ondrejmirtes ondrejmirtes merged commit 7080f40 into phpstan:1.12.x Sep 26, 2024
480 of 499 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@VincentLanglet
Copy link
Contributor Author

@ondrejmirtes Do you see more functions where the DynamicReturnExtension need to be written/modified ?

@staabm
Copy link
Contributor

staabm commented Sep 26, 2024

@VincentLanglet I would search the codebase for places where other string accessory types are handled

Likely sprintf/printf is worth testing

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.

3 participants