Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce unnecessary calls into reflection #2614

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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