-
-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ltrim(class-string, '\\') is always a class-string #7483
Comments
In psalm this one was fixed with a conditional return type: vimeo/psalm#8219 |
looked into adding a stub for this with conditional return types, but i can't get phpdoc-parser to recognise using any other sting there makes it work just fine: am i writing or escaping the literal wrong? |
Just write a return type extension 😊 |
IMO a separate issue should be opened for that bug, so someone might fix it. Still we can implement the feature request using a extension like ondrey suggested. |
@greg0ire to make use of this change you need to declare your parameters as a |
Awesome! Thanks! Cc @derrabus |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature request
If you search for
ltrim
in all Doctrine packages, you'll find many calls toltrim
for normalization purposes, in particular normalizing a class-string prefixed with a backslash into one without. I think the rule expressed in the title is always true, but PHPStan does not seem to have that built-in (I must admit it's quite specific): https://phpstan.org/r/be10b00c-b052-4f86-805b-cc783dd21cd4Did PHPStan help you today? Did it make you happy in any way?
I'm working on improving phpdoc on
doctrine/orm
before using Rector to migrate that to PHP8 native type declarations, and it's very reassuring to have PHPStan check my work 🙂The text was updated successfully, but these errors were encountered: