Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/grumphp upgrade #54

Merged
merged 13 commits into from
Dec 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make load() non-returnable. Change service configuration + tag (confi…
…g -> task)
  • Loading branch information
mitrpaka committed Nov 30, 2020
commit d76696056f53cf1cbcb713cf73ba5a08a5520ac0
16 changes: 6 additions & 10 deletions src/Task/AbstractExternalExtensionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use GrumPHP\Extension\ExtensionInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Yaml\Yaml;

Expand Down Expand Up @@ -57,17 +56,14 @@ public function __construct() {
/**
* {@inheritdoc}
*/
public function load(ContainerBuilder $container): Definition {
public function load(ContainerBuilder $container): void {
$task = $container->register('task.' . $this->name, $this->class);
$task->addTag('grumphp.task', ['config' => $this->name]);
if (empty($this->arguments)) {
return $task;
if (!empty($this->arguments)) {
foreach ($this->arguments as $argument) {
$task->addArgument(new Reference($argument));
}
}
foreach ($this->arguments as $argument) {
$task->addArgument(new Reference($argument));
}

return $task;
$task->addTag('grumphp.task', ['task' => $this->name]);
}

}