Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 8, 2023
1 parent 8baf6d1 commit 4115456
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
8 changes: 8 additions & 0 deletions src/Reflection/Annotations/AnnotationMethodReflection.php
Expand Up @@ -113,6 +113,14 @@ public function hasSideEffects(): TrinaryLogic
return TrinaryLogic::createYes();
}

foreach ($this->getVariants() as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
}
}

return TrinaryLogic::createMaybe();
}

Expand Down
10 changes: 4 additions & 6 deletions src/Reflection/Php/PhpFunctionFromParserNodeReflection.php
Expand Up @@ -199,12 +199,10 @@ public function hasSideEffects(): TrinaryLogic
if ($this->isPure !== null) {
return TrinaryLogic::createFromBoolean(!$this->isPure);
}
if ($this->variants !== null) {
foreach ($this->variants as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
foreach ($this->getVariants() as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions src/Reflection/Php/PhpFunctionReflection.php
Expand Up @@ -245,12 +245,10 @@ public function hasSideEffects(): TrinaryLogic
if ($this->isPure !== null) {
return TrinaryLogic::createFromBoolean(!$this->isPure);
}
if ($this->variants !== null) {
foreach ($this->variants as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
foreach ($this->getVariants() as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions src/Reflection/Php/PhpMethodReflection.php
Expand Up @@ -416,12 +416,10 @@ public function hasSideEffects(): TrinaryLogic
if ($this->isPure !== null) {
return TrinaryLogic::createFromBoolean(!$this->isPure);
}
if ($this->variants !== null) {
foreach ($this->variants as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
foreach ($this->getVariants() as $variant) {
foreach ($variant->getParameters() as $parameter) {
if ($parameter->passedByReference()->yes()) {
return TrinaryLogic::createYes();
}
}
}
Expand Down

0 comments on commit 4115456

Please sign in to comment.