ApiGen\Parser\Reflection\ReflectionConstant::getTypeHint PHP Method

getTypeHint() public method

public getTypeHint ( )
    public function getTypeHint()
    {
        if ($annotations = $this->getAnnotation('var')) {
            list($types) = preg_split('~\\s+|$~', $annotations[0], 2);
            if (!empty($types)) {
                return $types;
            }
        }
        try {
            $type = gettype($this->getValue());
            if (strtolower($type) !== 'null') {
                return $type;
            }
        } catch (\Exception $e) {
            return null;
        }
    }