Skip to content
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

php8: added union types and static typehint #22

Merged
merged 2 commits into from
Jul 27, 2021
Merged

Conversation

i582
Copy link
Owner

@i582 i582 commented Jul 27, 2021

Added new grammar rules, as in PHP-Parser:

  • union_type
  • type_expr_without_static
  • type_without_static
  • union_type_without_static
  • optional_type_without_static

Renamed return_type with optional_return_type to more closely
match the PHP-Parser grammar.

Removed grammar rule optional_type since it is not used now.

Added the Builder.NewSeparatedListWithTwoElements method to
create lists with two elements at once.

Moved the code from the grammar rules to the Builder methods.
Added following methods:

  • NewNameType
  • NewNullableType
  • NewUnionType
  • NewReturnType

Closes #21

Added new grammar rules, as in PHP-Parser:
- union_type
- type_expr_without_static
- type_without_static
- union_type_without_static
- optional_type_without_static

Renamed 'return_type' with 'optional_return_type' to more closely
match the PHP-Parser grammar.

Removed grammar rule 'optional_type' since it is not used now.
@i582 i582 added the PHP 8 PHP 8 features label Jul 27, 2021
@i582 i582 changed the title php8: added union types and static type php8: added union types and static typehint Jul 27, 2021
@i582 i582 merged commit 782a3d2 into php8_dev Jul 27, 2021
@i582 i582 deleted the pmakhnev/add_union_types branch July 27, 2021 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP 8 PHP 8 features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant