PHPStan\Reflection\Php\PhpClassReflectionExtension::getPropertyAnnotationTypeString PHP Method

getPropertyAnnotationTypeString() private method

private getPropertyAnnotationTypeString ( ReflectionProperty $propertyReflection ) : string | null
$propertyReflection ReflectionProperty
return string | null
    private function getPropertyAnnotationTypeString(\ReflectionProperty $propertyReflection)
    {
        $phpDoc = $propertyReflection->getDocComment();
        if ($phpDoc === false) {
            return null;
        }
        $count = preg_match_all('#@var\\s+' . FileTypeMapper::TYPE_PATTERN . '#', $phpDoc, $matches);
        if ($count !== 1) {
            return null;
        }
        return $matches[1][0];
    }