Skip to content

Conversation

@nsfisis
Copy link
Contributor

@nsfisis nsfisis commented Oct 27, 2025

Part of #2169

Support enum definition since PHP 8.1.

https://www.php.net/manual/en/language.enumerations.basics.php

enum Suit
{
    case Hearts;
    case Diamonds;
    case Clubs;
    case Spades;
}

https://www.php.net/manual/en/language.enumerations.backed.php

enum Suit: string
{
    case Hearts = 'H';
    case Diamonds = 'D';
    case Clubs = 'C';
    case Spades = 'S';
}

This pull requests introduced three new states:

  • in_enum
  • in_enum_base_type: handles syntax rule of backed-enum, an enum type having base type.
  • in_enum_body: handles case keyword.

@nsfisis nsfisis mentioned this pull request Oct 27, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant