Skip to content

Commit d5a6a63

Browse files
committed
Simplify code thanks to PHP-Parser update
1 parent 3119fe9 commit d5a6a63

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Reflection/Php/PhpMethodFromParserNodeReflection.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\Reflection\Php;
44

5-
use PhpParser\Modifiers;
65
use PhpParser\Node;
76
use PhpParser\Node\Stmt\ClassMethod;
87
use PHPStan\Reflection\Assertions;
@@ -230,20 +229,15 @@ public function isFinal(): TrinaryLogic
230229
{
231230
$method = $this->getClassMethod();
232231
if ($method instanceof Node\PropertyHook) {
233-
return TrinaryLogic::createFromBoolean((bool) ($method->flags & Modifiers::FINAL));
232+
return TrinaryLogic::createFromBoolean($method->isFinal());
234233
}
235234

236235
return TrinaryLogic::createFromBoolean($method->isFinal() || $this->isFinal);
237236
}
238237

239238
public function isFinalByKeyword(): TrinaryLogic
240239
{
241-
$method = $this->getClassMethod();
242-
if ($method instanceof Node\PropertyHook) {
243-
return TrinaryLogic::createFromBoolean((bool) ($method->flags & Modifiers::FINAL));
244-
}
245-
246-
return TrinaryLogic::createFromBoolean($method->isFinal());
240+
return TrinaryLogic::createFromBoolean($this->getClassMethod()->isFinal());
247241
}
248242

249243
public function isBuiltin(): bool

0 commit comments

Comments
 (0)