Skip to content

Commit 6213c61

Browse files
committed
Remove useless PHP_VERSION_ID checks for PHP 8.1
1 parent 8516791 commit 6213c61

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/UsedSymbolExtractor.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use function strlen;
1212
use function strtolower;
1313
use function substr;
14-
use const PHP_VERSION_ID;
1514
use const T_AS;
1615
use const T_ATTRIBUTE;
1716
use const T_CLASS;
@@ -91,7 +90,7 @@ public function parseUsedSymbols(
9190
case T_CLASS:
9291
case T_INTERFACE:
9392
case T_TRAIT:
94-
case PHP_VERSION_ID >= 80_100 ? T_ENUM : -1:
93+
case T_ENUM:
9594
$inClassLevel = $level + 1;
9695
break;
9796

@@ -349,7 +348,7 @@ private function canBeSymbolName(
349348
|| $tokenBeforeName->id === T_CLASS
350349
|| $tokenBeforeName->id === T_INTERFACE
351350
|| $tokenBeforeName->id === T_TRAIT
352-
|| $tokenBeforeName->id === (PHP_VERSION_ID >= 80_100 ? T_ENUM : -1)
351+
|| $tokenBeforeName->id === T_ENUM
353352
|| $tokenBeforeName->id === T_NULLSAFE_OBJECT_OPERATOR
354353
|| $tokenAfterName->id === T_INSTEADOF
355354
|| $tokenAfterName->id === T_AS

tests/UsedSymbolExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PHPUnit\Framework\TestCase;
77
use function file_get_contents;
88
use function strtolower;
9-
use const PHP_VERSION_ID; // only needed for PHP 8.1+ (enum) and 8.4+ (property hooks) checks
9+
use const PHP_VERSION_ID;
1010

1111
class UsedSymbolExtractorTest extends TestCase
1212
{

0 commit comments

Comments
 (0)