Skip to content

Commit

Permalink
Reduce unnecessary calls into reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Sep 9, 2023
1 parent 4241667 commit 19801d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Reflection/Php/PhpMethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,21 @@ public function getDeprecatedDescription(): ?string

public function isDeprecated(): TrinaryLogic
{
return $this->reflection->isDeprecated()->or(TrinaryLogic::createFromBoolean($this->isDeprecated));
if ($this->isDeprecated) {
return TrinaryLogic::createYes();
}

return $this->reflection->isDeprecated();
}

public function isInternal(): TrinaryLogic
{
return TrinaryLogic::createFromBoolean($this->reflection->isInternal() || $this->isInternal);
return TrinaryLogic::createFromBoolean($this->isInternal || $this->reflection->isInternal());
}

public function isFinal(): TrinaryLogic
{
return TrinaryLogic::createFromBoolean($this->reflection->isFinal() || $this->isFinal);
return TrinaryLogic::createFromBoolean($this->isFinal || $this->reflection->isFinal());
}

public function isAbstract(): bool
Expand Down

0 comments on commit 19801d9

Please sign in to comment.