protected function generateOptimizedClassmap()
    {
        $composerCommand = $this->getComposerCommand();

        if (!$composerCommand) {
            $this->logger->log('<error>Could not find composer command</error>');
            return false;
        }

        $process = new Process($composerCommand . ' dump-autoload --optimize', $this->projectPath);
        $process->run();

        if (!$process->isSuccessful()) {
            $this->logger->log('<error>Could not optimize class map</error>');
        }

        $this->logger->log('<info>Optimized class map</info>');
        unset($process);

        return true;
    }