Skip to content

Commit

Permalink
Add TypeCastContext::getReflection() (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Oct 11, 2023
1 parent 7085eb9 commit 1a45a4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/TypeCaster/TypeCastContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ final class TypeCastContext
{
public function __construct(
private HydratorInterface $hydrator,
private ReflectionParameter|ReflectionProperty $item,
private ReflectionParameter|ReflectionProperty $reflection,
) {
}

public function getReflection(): ReflectionParameter|ReflectionProperty
{
return $this->reflection;
}

public function getReflectionType(): ?ReflectionType
{
return $this->item->getType();
return $this->reflection->getType();
}

public function getHydrator(): HydratorInterface
Expand Down

0 comments on commit 1a45a4b

Please sign in to comment.