public function lookup(string $localType): string
    {
        $localType = \trim($localType);
        
        if ($localType === '') {
            return $this->namespace;
        }
        
        if ($localType[0] === '\\') {
            return \trim($localType, '\\');
        }
        
        $type = \strtolower($localType);
        
        if (\strpos($type, '\\') === false) {
            // Type import lookup.
            if (\array_key_exists($type, $this->imports)) {
                return $this->imports[$type];
            }
        } else {
            // Namespace import lookup.
            $tmp = \explode('\\', $localType, 2);
            $tmp[0] = \strtolower($tmp[0]);
            
            if (\array_key_exists($tmp[0], $this->imports)) {
                return \ltrim($this->imports[$tmp[0]] . '\\' . $tmp[1], '\\');
            }
        }
        
        return \ltrim($this->namespace . '\\', '\\') . $localType;
    }