private function getTypesFromVarComment(string $property, ReflectionClass $traitReflection): array
    {
        $docComment = $this->reflectionClass->getProperty($property)->getDocComment();
        \preg_match('%@var\s*?(.+)%', $docComment, $matches);
        $traitCode = \ts\file_get_contents($traitReflection->getFileName());
        $types     = \explode('|', $matches[1]);
        $return    = [];
        foreach ($types as $type) {
            $type = \trim($type);
            if ('null' === $type) {
                continue;
            }
            if ('ArrayCollection' === $type) {
                continue;
            }
            $arrayNotation = '';
            if ('[]' === substr($type, -2)) {
                $type          = substr($type, 0, -2);
                $arrayNotation = '[]';
            }
            $pattern = "%^use (.+?)\\\\${type}(;| |\[)%m";
            \preg_match($pattern, $traitCode, $matches);
            if (!isset($matches[1])) {
                throw new \RuntimeException(
                    'Failed finding match for type ' . $type . ' in ' . $traitReflection->getFileName()
                );
            }
            $return[] = $matches[1] . '\\' . $type . $arrayNotation;
        }

        return $return;
    }