Skip to content

Commit c045c0b

Browse files
authored
Removed the php version check. (#5850)
1 parent cc922b4 commit c045c0b

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

tests/PhpParserTest.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,18 @@ public function testGetAstFromReflectionParameter()
4949
$this->assertSame(['', 'HyperfTest', 'CodeParser', 'Stub', 'Foo'], $foo2->type->parts);
5050
$this->assertNodeParam($extra, $parser->getNodeFromReflectionParameter($parameters[2]));
5151

52-
if (PHP_VERSION_ID > 80000) {
53-
$stmts = $parser7->parse(file_get_contents(__DIR__ . '/Stub/UnionTypeFoo.php'));
54-
/** @var ClassMethod $classMethod */
55-
$classMethod = $stmts[1]->stmts[0]->stmts[0];
56-
$name = $classMethod->getParams()[0];
57-
58-
$foo = new ReflectionClass(UnionTypeFoo::class);
59-
$parameters = $foo->getMethod('__construct')->getParameters();
60-
$this->assertNodeParam($name, $parser->getNodeFromReflectionParameter($parameters[0]));
61-
}
52+
$stmts = $parser7->parse(file_get_contents(__DIR__ . '/Stub/UnionTypeFoo.php'));
53+
/** @var ClassMethod $classMethod */
54+
$classMethod = $stmts[1]->stmts[0]->stmts[0];
55+
$name = $classMethod->getParams()[0];
56+
57+
$foo = new ReflectionClass(UnionTypeFoo::class);
58+
$parameters = $foo->getMethod('__construct')->getParameters();
59+
$this->assertNodeParam($name, $parser->getNodeFromReflectionParameter($parameters[0]));
6260
}
6361

6462
public function testGetExprFromEnum()
6563
{
66-
if (PHP_VERSION_ID < 80100) {
67-
$this->markTestSkipped('The version below 8.1 does not support enum.');
68-
}
69-
7064
$parser = new PhpParser();
7165
$printer = new Standard();
7266

tests/Stub/FooEnum.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
*/
1212
namespace HyperfTest\CodeParser\Stub;
1313

14-
if (PHP_VERSION_ID > 80100) {
15-
enum FooEnum: int
16-
{
17-
case DEFAULT = 1;
18-
}
14+
enum FooEnum: int
15+
{
16+
case DEFAULT = 1;
1917
}

0 commit comments

Comments
 (0)