/** * @param ReflectionProperty $property * @param mixed $value * * @return mixed */ public function castValue(ReflectionProperty $property, $value) { $typHint = $property->getTypeHint(); if ($typHint->definesObject()) { return $this->castToObject($typHint, $value); } else { return $this->castToScalar($typHint, $value); } }
/** * ReflectionProperty constructor. * * @param mixed $class * @param string $name */ public function __construct($class, $name) { parent::__construct($class, $name); $this->typeHint = new TypHint($this); }