private function updateComposerReplacesVersion($version, array $component)
    {
        $composer = $this->rootPath() .'/composer.json';
        if (!file_exists($composer)) {
            throw new \Exception('Invalid composer.json path');
        }

        $data = json_decode(file_get_contents($composer), true);

        $data['replace'][$component['name']] = $version;

        file_put_contents($composer, json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
    }