private function buildInternal(array $arguments)
    {
        $builder = ProcessBuilder::create($this->config->getPhpCliBinary());

        if (null !== ($cliArguments = $this->config->getPhpCliArguments())) {
            $builder->addArguments($cliArguments);
        }
        $builder->addArguments($arguments);

        if (null !== ($environment = $this->config->getPhpCliEnvironment())) {
            foreach ($environment as $name => $value) {
                $builder->setEnv($name, $value);
            }
        }
        // MUST be kept last.
        $builder->setEnv('COMPOSER', $this->homePath . DIRECTORY_SEPARATOR . 'composer.json');

        return $builder;
    }