public function drupalRefresh($opts = [
        'db-name' => null,
        'db-user' => null,
        'db-pass' => null,
        'db-host' => null,
        'db-port' => null,
        'db-protocol' => null,
        'hard' => false,
        'localhost' => false,
    ])
    {
        $this->executeCommandHook(__FUNCTION__, 'before');
        $localhost = $opts['localhost'];

        /** @var DrupalProjectType $instance */
        $instance = $this->getProjectInstance();
        $version = $instance->getProjectVersion();

        // Composer install.
        $this->taskComposerInstall()->run();

        if ($opts['hard']) {
            $database = $this->buildDatabase($opts);
            // Reinstall the Drupal database, which drops the existing data.
            $instance
                ->setDatabaseOverride($database)
                ->setupDrupalInstall(
                    $localhost
                );

            if ($version >= 8) {
                $instance->setDrupalUuid($localhost);
            }
        }
        $drush = new DrushCommand(null, $localhost);

        if ($version >= 8) {
            $instance->runDrushCommand('updb --entity-updates', false, $localhost);
            $instance->importDrupalConfig(1, $localhost);
            $drush->command('cr');
        } else {
            $drush
                ->command('updb')
                ->command('cc all');
        }
        $instance->runDrushCommand($drush, false, $localhost);

        $this->executeCommandHook(__FUNCTION__, 'after');

        return $this;
    }