Skip to content

Commit

Permalink
OPENEUROPA-1535: Update coding style based on new code-review version.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 30, 2019
1 parent 0236ac1 commit f499e96
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 64 deletions.
8 changes: 4 additions & 4 deletions src/Commands/AbstractDrupalCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ abstract class AbstractDrupalCommands extends AbstractCommands implements Filesy
public function getDrupal()
{
return $this->getConfig()->get('drupal.core') === 7 ?
new Drupal7Commands() :
new Drupal8Commands();
new Drupal7Commands() :
new Drupal8Commands();
}

/**
Expand Down Expand Up @@ -284,8 +284,8 @@ 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();
Expand Down
12 changes: 6 additions & 6 deletions src/Commands/ChangelogCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function getConfigurationFile()
* @return \Robo\Task\Docker\Run
*/
public function generateChangelog(array $options = [
'token' => InputOption::VALUE_REQUIRED,
'tag' => InputOption::VALUE_OPTIONAL,
'token' => InputOption::VALUE_REQUIRED,
'tag' => InputOption::VALUE_OPTIONAL,
])
{
$projectName = $this->getComposer()->getName();
Expand All @@ -52,10 +52,10 @@ public function generateChangelog(array $options = [
}

$task = $this->taskDockerRun('muccg/github-changelog-generator')
->option('rm')
->rawArg('-v $(pwd):$(pwd)')
->rawArg('-w $(pwd)')
->exec($exec);
->option('rm')
->rawArg('-v $(pwd):$(pwd)')
->rawArg('-w $(pwd)')
->exec($exec);

return $task;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Commands/ReleaseCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public function setRuntimeConfig(ConsoleCommandEvent $event)
* @aliases release:ca,rca
*/
public function createRelease(array $options = [
'tag' => InputOption::VALUE_OPTIONAL,
'keep' => false,
'tag' => InputOption::VALUE_OPTIONAL,
'keep' => false,
])
{
$name = $this->composer->getProject();
Expand All @@ -96,12 +96,12 @@ public function createRelease(array $options = [

$tasks = [
// Make sure we do not have a release directory yet.
$this->taskFilesystemStack()->remove([$archive, $name]),
$this->taskFilesystemStack()->remove([$archive, $name]),

// Get non-modified code using git archive.
$this->taskGitStack()->exec(["archive", "HEAD", "-o $name.zip"]),
$this->taskExtract("$name.zip")->to("$name"),
$this->taskFilesystemStack()->remove("$name.zip"),
$this->taskGitStack()->exec(["archive", "HEAD", "-o $name.zip"]),
$this->taskExtract("$name.zip")->to("$name"),
$this->taskFilesystemStack()->remove("$name.zip"),
];

// Append release tasks defined in runner.yml.dist.
Expand Down
16 changes: 8 additions & 8 deletions src/Contract/RepositoryAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
interface RepositoryAwareInterface
{

/**
* @return Repository
*/
/**
* @return Repository
*/
public function getRepository();

/**
* @param \Gitonomy\Git\Repository $repository
*
* @return $this
*/
/**
* @param \Gitonomy\Git\Repository $repository
*
* @return $this
*/
public function setRepository(Repository $repository);
}
12 changes: 6 additions & 6 deletions src/TaskRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ private function createContainer(InputInterface $input, OutputInterface $output,

// Add service inflectors.
$container->inflector(ComposerAwareInterface::class)
->invokeMethod('setComposer', ['task_runner.composer']);
->invokeMethod('setComposer', ['task_runner.composer']);
$container->inflector(TimeAwareInterface::class)
->invokeMethod('setTime', ['task_runner.time']);
->invokeMethod('setTime', ['task_runner.time']);
$container->inflector(FilesystemAwareInterface::class)
->invokeMethod('setFilesystem', ['filesystem']);
->invokeMethod('setFilesystem', ['filesystem']);
$container->inflector(RepositoryAwareInterface::class)
->invokeMethod('setRepository', ['repository']);
->invokeMethod('setRepository', ['repository']);

return $container;
}
Expand All @@ -190,8 +190,8 @@ private function createApplication()
{
$application = new Application(self::APPLICATION_NAME, 'UNKNOWN');
$application
->getDefinition()
->addOption(new InputOption('--working-dir', null, InputOption::VALUE_REQUIRED, 'Working directory, defaults to current working directory.', $this->workingDir));
->getDefinition()
->addOption(new InputOption('--working-dir', null, InputOption::VALUE_REQUIRED, 'Working directory, defaults to current working directory.', $this->workingDir));

return $application;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Tasks/CollectionFactory/CollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ protected function taskFactory($task)

// Map dynamic task type to actual task callback.
$map = [
'append' => "taskAppendConfiguration",
'prepend' => "taskPrependConfiguration",
'write' => "taskWriteConfiguration",
'append' => "taskAppendConfiguration",
'prepend' => "taskPrependConfiguration",
'write' => "taskWriteConfiguration",
];

if (!isset($map[$task['type']])) {
Expand All @@ -177,7 +177,7 @@ protected function taskFactory($task)

// Add selected process task and return collection.
$tasks[] = $this->{$method}($task['destination'], $this->getConfig())
->setConfigKey($task['config']);
->setConfigKey($task['config']);

return $this->collectionBuilder()->addTaskList($tasks);

Expand Down
30 changes: 15 additions & 15 deletions tests/Commands/ReleaseCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,23 @@ protected function getRepositoryMock(array $repository)
}

$mock = $this->getMockBuilder(Repository::class)
->disableOriginalConstructor()
->setMethods([
'getHead',
'getReferences',
'resolveTags',
'getBranches',
])
->getMock();
->disableOriginalConstructor()
->setMethods([
'getHead',
'getReferences',
'resolveTags',
'getBranches',
])
->getMock();

$head = $this->getMockBuilder(Commit::class)
->disableOriginalConstructor()
->setMethods([
'getCommit',
'getRevision',
'getHash',
])
->getMock();
->disableOriginalConstructor()
->setMethods([
'getCommit',
'getRevision',
'getHash',
])
->getMock();
$head->expects($this->any())->method('getCommit')->willReturnSelf();
$head->expects($this->any())->method('getHash')->willReturn($repository['hash']);
$head->expects($this->any())->method('getRevision')->willReturn($repository['revision']);
Expand Down
20 changes: 10 additions & 10 deletions tests/CommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ public function testCustomCommands()
$runner->run();

$expected = [
"custom:command-four",
"custom:command-one",
"custom:command-three",
"custom:command-two",
"custom:command-four",
"custom:command-one",
"custom:command-three",
"custom:command-two",
];

$text = $output->fetch();
Expand Down Expand Up @@ -195,8 +195,8 @@ function $fct() {}
EOF;

$config_override_filename = isset($config['drupal']['site']['settings_override_file']) ?
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';

// Add the dummy PHP code to the config override file.
file_put_contents(
Expand Down Expand Up @@ -246,8 +246,8 @@ function $fct() {}
EOF;

$config_override_filename = isset($config['drupal']['site']['settings_override_file']) ?
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';

// Add the dummy PHP code to the config override file.
file_put_contents(
Expand Down Expand Up @@ -301,8 +301,8 @@ function $fct() {}
EOF;

$config_override_filename = isset($config['drupal']['site']['settings_override_file']) ?
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';
$config['drupal']['site']['settings_override_file'] :
'settings.override.php';

// Add the dummy PHP code to the config override file.
file_put_contents(
Expand Down
10 changes: 5 additions & 5 deletions tests/Tasks/CollectionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public function testProcessPhpTask($type, $override, $destinationExists, $source

$tasks = [];
$tasks[] = [
'task' => 'process-php',
'config' => 'drupal.drush',
'type' => $type,
'source' => $sourceFile,
'destination' => $destinationFile,
'task' => 'process-php',
'config' => 'drupal.drush',
'type' => $type,
'source' => $sourceFile,
'destination' => $destinationFile,
];

// Make sure we test default override option by not setting it if null.
Expand Down

0 comments on commit f499e96

Please sign in to comment.