public function setupProjectComposer()
    {
        $this->mergeProjectComposerTemplate();
        $install_root = substr(static::installRoot(), 1);
        $version = $this->getProjectVersion();

        $this->composer
            ->setType('project')
            ->setPreferStable(true)
            ->setMinimumStability('dev')
            ->setConfig([
                'platform' => [
                    'php' => "{$this->getEnvPhpVersion()}"
                ]
            ])
            ->addRepository('drupal', [
                'type' => 'composer',
                'url' =>  "https://packages.drupal.org/{$version}"
            ])
            ->addRequires([
                'drupal/core' => static::DRUPAL_8_VERSION,
                'composer/installers' => '^1.1',
                'cweagans/composer-patches' =>  '^1.5',
                'drupal-composer/drupal-scaffold' => '^2.0'
            ])
            ->addExtra('drupal-scaffold', [
                'excludes' => [
                    'robot.txt'
                ],
                'initial' => [
                    'sites/development.services.yml' => 'sites/development.services.yml',
                    'sites/example.settings.local.php' => 'sites/example.settings.local.php'
                ],
                'omit-defaults' => false
            ])
            ->addExtra('installer-paths', [
                $install_root . '/core' => ['type:drupal-core'],
                $install_root . '/modules/contrib/{$name}' => ['type:drupal-module'],
                $install_root . '/profiles/custom/{$name}' => ['type:drupal-profile'],
                $install_root . '/themes/contrib/{$name}'=> ['type:drupal-theme'],
                'drush/contrib/{$name}'=> ['type:drupal-drush']
            ]);

        return $this;
    }