protected function hydrateValue($value, PropertyAnnotation $annotation)
    {
        if ($annotation->type) {
            try {
                $value = $this->castProperty($annotation, $value);
            } catch (\Exception $e) {
                if ($annotation->isNullable()) {
                    $value = null;
                } else {
                    throw $e;
                }
            }
        }
        return $value;
    }
protected function hydrateValue($value, PropertyAnnotation $annotation)
    {
        if ($annotation->type) {
            try {
                $value = $this->castProperty($annotation, $value);
            } catch (\Exception $e) {
                if ($annotation->isNullable()) {
                    $value = null;
                } else {
                    throw $e;
                }
            }
        }
        return $value;
    }
protected function hydrateValue ( $ value , PropertyAnnotation $ annotation ) { if ( $ annotation -> type ) { try { $ value = $ this -> castProperty ( $ annotation , $ value ) ; } catch ( \ Exception $ e ) { if ( $ annotation -> isNullable ( ) ) { $ value = null ; } else { throw $ e ; } } } return $ value ; }
Hydrates the value

@param $value
@param PropertyAnnotation $annotation

@return mixed|null
@throws \Exception
Hydrates the value