-
-
Notifications
You must be signed in to change notification settings - Fork 83
Add support for DNF types #159
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get psalm happy, before continuing this :D
a6fdf0c
to
6f0e7ee
Compare
The tests are passing on both PHP 8.1 and 8.2. I added some more test cases too. Not sure if you want to keep There is a lot of mess and code duplication in Idk why is psalm crashing 🤷🏻♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking good from the tests: implementation will need a lot of careful reading / focus :)
Otherwise nice work!
I'll check it out locally when I can, and get it shipped.
The crash in psalm is... novel :O I wonder if we should just try going |
Psalm v5 crashes there too so no solution for that so far 😝 |
1fbc23a
to
49d964c
Compare
Signed-off-by: Ion Bazan <ion.bazan@gmail.com>
Signed-off-by: Ion Bazan <ion.bazan@gmail.com>
…ting DNF types Disjunctive Normal Form types are hard, yo! Signed-off-by: Marco Pivetta <ocramius@gmail.com>
@IonBazan I'm picking this up: |
Great, thanks! Let me know if any help is needed. |
This stuff is a bunch of junk: on purpose. Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…empty-string` Signed-off-by: Marco Pivetta <ocramius@gmail.com>
… effects Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…always guaranteed to be generated Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Since `vimeo/psalm:^5`, inheriting from a class that declares generic types also does require generic types to be declared while extending. Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…g and type improvements Signed-off-by: Marco Pivetta <ocramius@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still working on it - got stuck on paid work :P
…nternals Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…pe` instances Signed-off-by: Marco Pivetta <ocramius@gmail.com>
… `IntersectionType` instances Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…ted internally Signed-off-by: Marco Pivetta <ocramius@gmail.com>
…/intersection type abstractions Signed-off-by: Marco Pivetta <ocramius@gmail.com>
This massively reduces the internal complexity of the `TypeGenerator`, since we convert `ReflectionType` symbols **directly** to our `@internal` data structures, ready to be rendered. Before this, we would cast the whole `ReflectionType` to a `string` that fits our need, and then we would go back to parsing that string, with a substantial overhead (especially considering the newly introduced validation rules around DNF types). Note that this introduces new Psalm violations that were added to `psalm-baseline.xml`, but which are solved by my work @ vimeo/psalm#8722 Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
@IonBazan as you can see, I ended up using a radically different representation of internal types, mostly so that it can be understood at runtime. Shipping this now :) |
…not useful in this codebase Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Description
Basic support for DNF types (as per #142)
Code review welcome, I'd like to know if this is the right direction. Collaboration is welcome too 🙏🏻 .