Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[TypeInfo] AddExplicitStringType
andClassLikeStringType
classes to hold specific type details forstring
builtin types#59833
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thinking about it once again, I really wonder if we need to deal with all "PHPStan specific" types in Symfony. I understand that it can exist use cases, but I'm afraid to re-do a PHPStan in Symfony. Implementing all the types ofhttps://phpstan.org/writing-php-code/phpdoc-types looks like a bad idea to me. IMHO, Symfony needs to understandstructural information of types, but knowing that a string is escaped, or an integer is between a specific range is not needed often enough. WDYT? (The same applies to#59676) |
chalasr commentedFeb 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I tend to agree this goes beyond type-info’s scope. |
I also agree. Thus, the more complex our types become, the harder it becomes to define the API (see the phpstan type API). |
Fine. I'll close both PRs. I suppose this means#59827 will also not happen... |
The array shape type is only one that is worth being merged in my opinion, as it is astructural and widely used type, such as |
Again thanks for having tried that, and for the great work here@DerManoMann 🙂 |
Just for the record - I've started moving my changes into a separate repo. Not ideal as it means forking at least the https://github.com/DerManoMann/type-info-extras Any issues around license, etc. let me know as they are not intentional. |
Add
ExplicitStringType
which holds the explicit type forstring
builtin types.Also adds
ClassLikeStringType
which in addition holds the associatedObjectType
for class like strings that contain a class name, for exampleclass-string<FooBar>