Skip to content

Commit

Permalink
getClassReflectionOrNull
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed May 11, 2024
1 parent d7876a9 commit 5f394b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Type/Enum/EnumCaseObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function isSuperTypeOf(Type $type): TrinaryLogic
return $type->isSubTypeOf($this);
}

$parent = new parent($this->getClassName(), $this->getSubtractedType());
$parent = new parent($this->getClassName(), $this->getSubtractedType(), $this->getClassReflectionOrNull());

return $parent->isSuperTypeOf($type)->and(TrinaryLogic::createMaybe());
}
Expand Down Expand Up @@ -165,7 +165,7 @@ public function getBackingValueType(): ?Type

public function generalize(GeneralizePrecision $precision): Type
{
return new parent($this->getClassName());
return new parent($this->getClassName(), null, $this->getClassReflectionOrNull());
}

public function isSmallerThan(Type $otherType): TrinaryLogic
Expand Down
5 changes: 5 additions & 0 deletions src/Type/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -1479,6 +1479,11 @@ public function getClassReflection(): ?ClassReflection
return $classReflection;
}

protected function getClassReflectionOrNull(): ?ClassReflection
{
return $this->classReflection;
}

/**
* @return self|null
*/
Expand Down

0 comments on commit 5f394b2

Please sign in to comment.