Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Support union types #15

Open
j6s opened this issue Jun 29, 2020 · 2 comments
Open

Support union types #15

j6s opened this issue Jun 29, 2020 · 2 comments

Comments

@j6s
Copy link
Owner

j6s commented Jun 29, 2020

While reviewing #14 we realized that union types (such as Foo|Bar) are not supported yet.

  • Union types in docblock typehints should be parsed as each of the component
  • Union types in actual type declarations ( https://wiki.php.net/rfc/union_types_v2 ) should be parsed
  • Union types in generics (e.g. Baz<Foo|Bar>) should also be parsed as each component + the wrapper
@bestform
Copy link
Contributor

Keep in mind that this feature will be added in PHP8. As this project requires PHP 7.2 or higher, it either needs to be bumped to PHP8 or the code must reflect this by skipping those cases or it will probably break when running with PHP7 - at least when running the tests while trying to parse the respective test classes.

@j6s
Copy link
Owner Author

j6s commented Jun 30, 2020

That I hadn't considered, yeah. For the beginning just supporting it in docblocks would go a long way.

j6s added a commit that referenced this issue Sep 22, 2021
This adds
* Template type resolution
* Union types in docblocks
* More robust array syntax detection

See #15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants