Skip to content

Commit d9d0c14

Browse files
authored
fix: enum as identifier (#1995)
1 parent 1c9a8dd commit d9d0c14

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"linguist-languages": "^7.5.1",
1515
"mem": "^8.0.0",
16-
"php-parser": "3.1.0-beta.8"
16+
"php-parser": "3.1.0-beta.9"
1717
},
1818
"devDependencies": {
1919
"@babel/preset-env": "^7.18.0",

tests/enum/__snapshots__/jsfmt.spec.js.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ enum BackedSuit: string
7070
{
7171
case Spades = 5;
7272
}
73+
74+
class Enum {}
75+
class Enum extends Foo {}
76+
7377
=====================================output=====================================
7478
<?php
7579
@@ -136,5 +140,12 @@ enum BackedSuit: string
136140
case Spades = 5;
137141
}
138142
143+
class Enum
144+
{
145+
}
146+
class Enum extends Foo
147+
{
148+
}
149+
139150
================================================================================
140151
`;

tests/enum/enum.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,7 @@ class Foo
6161
enum BackedSuit: string
6262
{
6363
case Spades = 5;
64-
}
64+
}
65+
66+
class Enum {}
67+
class Enum extends Foo {}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,10 +3940,10 @@ path-type@^4.0.0:
39403940
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
39413941
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
39423942

3943-
3944-
version "3.1.0-beta.8"
3945-
resolved "https://registry.yarnpkg.com/php-parser/-/php-parser-3.1.0-beta.8.tgz#fc2bda8b5e310a115dcbe4a3c85bb13131f7b2c4"
3946-
integrity sha512-TA4zYkVGv0Daail0yGZIUUxYWt37hz5nfaLgx17Tn25wdyoW4xtjv6UphrtyFCxNL1sZgJvSb5Q83zw76ZP/uA==
3943+
3944+
version "3.1.0-beta.9"
3945+
resolved "https://registry.yarnpkg.com/php-parser/-/php-parser-3.1.0-beta.9.tgz#f7a57c01d8483cb1401c516b797c610d2e91823f"
3946+
integrity sha512-cGVXw3IRbA5zwO3nnp3yKQhCsF4kZqodunlzaqK/xw9AhXhBazpmkxcazv//b430IVVYrt0UzH5kc0JMGg9t3A==
39473947

39483948
picocolors@^1.0.0:
39493949
version "1.0.0"

0 commit comments

Comments
 (0)