Skip to content

Commit

Permalink
OPENEUROPA-287: Coding standards, spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yemoko authored and drupol committed Jun 14, 2018
1 parent 054e10c commit e10dbc0
Showing 1 changed file with 44 additions and 45 deletions.
89 changes: 44 additions & 45 deletions src/Commands/DrupalCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*
* @package OpenEuropa\TaskRunner\Commands
*/

class DrupalCommands extends AbstractCommands implements FilesystemAwareInterface
{
use TaskRunnerTraits\ConfigurationTokensTrait;
Expand All @@ -42,7 +41,7 @@ public function getConfigurationFile()
*/
public function setRuntimeConfig(ConsoleCommandEvent $event)
{
$root = $this->getConfig()->get('drupal.root');
$root = $this->getConfig()->get('drupal.root');
$rootFullPath = realpath($root);
if ($rootFullPath) {
$this->getConfig()->set('drupal.root_absolute', $rootFullPath);
Expand Down Expand Up @@ -105,45 +104,45 @@ public function validateSiteInstall(CommandData $commandData)
* @return \Robo\Collection\CollectionBuilder
*/
public function siteInstall(array $options = [
'root' => InputOption::VALUE_REQUIRED,
'base-url' => InputOption::VALUE_REQUIRED,
'site-name' => InputOption::VALUE_REQUIRED,
'site-mail' => InputOption::VALUE_REQUIRED,
'site-profile' => InputOption::VALUE_REQUIRED,
'site-update' => InputOption::VALUE_REQUIRED,
'site-locale' => InputOption::VALUE_REQUIRED,
'account-name' => InputOption::VALUE_REQUIRED,
'account-password' => InputOption::VALUE_REQUIRED,
'account-mail' => InputOption::VALUE_REQUIRED,
'database-user' => InputOption::VALUE_REQUIRED,
'database-password' => InputOption::VALUE_REQUIRED,
'database-host' => InputOption::VALUE_REQUIRED,
'database-port' => InputOption::VALUE_REQUIRED,
'database-name' => InputOption::VALUE_REQUIRED,
'sites-subdir' => InputOption::VALUE_REQUIRED,
])
'root' => InputOption::VALUE_REQUIRED,
'base-url' => InputOption::VALUE_REQUIRED,
'site-name' => InputOption::VALUE_REQUIRED,
'site-mail' => InputOption::VALUE_REQUIRED,
'site-profile' => InputOption::VALUE_REQUIRED,
'site-update' => InputOption::VALUE_REQUIRED,
'site-locale' => InputOption::VALUE_REQUIRED,
'account-name' => InputOption::VALUE_REQUIRED,
'account-password' => InputOption::VALUE_REQUIRED,
'account-mail' => InputOption::VALUE_REQUIRED,
'database-user' => InputOption::VALUE_REQUIRED,
'database-password' => InputOption::VALUE_REQUIRED,
'database-host' => InputOption::VALUE_REQUIRED,
'database-port' => InputOption::VALUE_REQUIRED,
'database-name' => InputOption::VALUE_REQUIRED,
'sites-subdir' => InputOption::VALUE_REQUIRED,
])
{
$drush = $this->getConfig()->get('runner.bin_dir').'/drush';
$task = $this->taskDrush($drush)
->root($options['root'])
->siteName($options['site-name'])
->siteMail($options['site-mail'])
->locale($options['site-locale'])
->accountMail($options['account-mail'])
->accountName($options['account-name'])
->accountPassword($options['account-password'])
->databaseUser($options['database-user'])
->databasePassword($options['database-password'])
->databaseHost($options['database-host'])
->databasePort($options['database-port'])
->databaseName($options['database-name'])
->sitesSubdir($options['sites-subdir'])
->siteProfile($options['site-profile']);
->root($options['root'])
->siteName($options['site-name'])
->siteMail($options['site-mail'])
->locale($options['site-locale'])
->accountMail($options['account-mail'])
->accountName($options['account-name'])
->accountPassword($options['account-password'])
->databaseUser($options['database-user'])
->databasePassword($options['database-password'])
->databaseHost($options['database-host'])
->databasePort($options['database-port'])
->databaseName($options['database-name'])
->sitesSubdir($options['sites-subdir'])
->siteProfile($options['site-profile']);

return $this->collectionBuilder()->addTaskList([
$this->sitePreInstall(),
$task->siteInstall(),
$this->sitePostInstall(),
$this->sitePreInstall(),
$task->siteInstall(),
$this->sitePostInstall(),
]);
}

Expand Down Expand Up @@ -226,16 +225,16 @@ public function sitePreInstall()
* @return \Robo\Collection\CollectionBuilder
*/
public function drushSetup(array $options = [
'root' => InputOption::VALUE_REQUIRED,
'config-dir' => InputOption::VALUE_REQUIRED,
])
'root' => InputOption::VALUE_REQUIRED,
'config-dir' => InputOption::VALUE_REQUIRED,
])
{
$config = $this->getConfig();
$yaml = Yaml::dump($config->get('drupal.drush'));
$yaml = Yaml::dump($config->get('drupal.drush'));

return $this->collectionBuilder()->addTaskList([
$this->taskWriteConfiguration($options['root'].'/sites/default/drushrc.php', $config)->setConfigKey('drupal.drush'),
$this->taskWriteToFile($options['config-dir'].'/drush.yml')->text($yaml),
$this->taskWriteConfiguration($options['root'].'/sites/default/drushrc.php', $config)->setConfigKey('drupal.drush'),
$this->taskWriteToFile($options['config-dir'].'/drush.yml')->text($yaml),
]);
}

Expand Down Expand Up @@ -264,11 +263,11 @@ public function drushSetup(array $options = [
* @return \Robo\Collection\CollectionBuilder
*/
public function settingsSetup(array $options = [
'root' => InputOption::VALUE_REQUIRED,
])
'root' => InputOption::VALUE_REQUIRED,
])
{
return $this->collectionBuilder()->addTaskList([
$this->taskAppendConfiguration($options['root'].'/sites/default/default.settings.php', $this->getConfig())->setConfigKey('drupal.settings'),
$this->taskAppendConfiguration($options['root'].'/sites/default/default.settings.php', $this->getConfig())->setConfigKey('drupal.settings'),
]);
}
}

0 comments on commit e10dbc0

Please sign in to comment.