-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[VarDumper] add support for enums on PHP 8.1 #40238
Labels
Comments
nicolas-grekas
added
the
Help wanted
Issues and PRs which are looking for volunteers to complete them.
label
Feb 18, 2021
24 tasks
Hi, enumerations seems to work well with |
Dunno, I didn't try yet :) |
enum UnitEnumFixture {
case Hearts;
case Diamonds;
case Clubs;
case Spades;
}
dump(UnitEnumFixture::Hearts);
enum BackedEnumFixture: string {
case Hearts = 'H';
case Diamonds = 'D';
case Clubs = 'C';
case Spades = 'S';
}
dump(BackedEnumFixture::Hearts);
|
That output looks good to me, let's close this issue. @shiftby: Do you want to submit a PR that adds tests for your two fixture classes, to make sure we don't break VarDumper for enums in the future? |
derrabus
added a commit
that referenced
this issue
Apr 19, 2021
This PR was merged into the 4.4 branch. Discussion ---------- [VarDumper] Add PHP 8.1 enums tests VarDumper component already supports PHP 8.1 enums, but didn't have tests | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #40238 | License | MIT | Doc PR | no VarDumper component already supports PHP 8.1 enums, but it didn't have tests. ```php enum UnitEnumFixture { case Hearts; case Diamonds; case Clubs; case Spades; } dump(UnitEnumFixture::Hearts); ``` ``` Symfony\Component\VarDumper\Tests\Fixtures\UnitEnumFixture {#435 +name: "Hearts" } ``` ```php enum BackedEnumFixture: string { case Hearts = 'H'; case Diamonds = 'D'; case Clubs = 'C'; case Spades = 'S'; } dump(BackedEnumFixture::Hearts); ``` ``` Symfony\Component\VarDumper\Tests\Fixtures\BackedEnumFixture {#157 +name: "Hearts" +value: "H" } ``` Commits ------- 9a2a027 [VarDumper] Add PHP 8.1 enums tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
https://wiki.php.net/rfc/enumerations
The text was updated successfully, but these errors were encountered: