public function addImport(Import $import)
    {
        if (isset($this->imports[$import->getClassName()])) {
            return $this;
        }

        $symbol = $import->getAlias() ?: $import->getShortClassName();

        if (isset($this->importedSymbols[$symbol])) {
            throw new RuntimeException(sprintf(
                'The symbol "%s" was imported already.',
                $import->getShortClassName()
            ));
        }

        $this->imports[$import->getClassName()] = $import;
        $this->importedSymbols[$symbol] = true;

        ksort($this->imports);

        return $this;
    }