Skip to content

Commit

Permalink
DQA-0: Fix Commands loaded twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaocsilva committed Oct 31, 2022
1 parent 6e8bc61 commit 5dc6211
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/TaskRunner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ public function __construct(ClassLoader $classLoader, InputInterface $input, Out
*/
public function run()
{
$classes = $this->discoverCommandClasses();
$this->runner->registerCommandClasses($this->application, $classes);

$this->registerConfigurationCommands();

return $this->runner->run($this->input, $this->output, $this->application);
}

Expand Down Expand Up @@ -267,20 +263,6 @@ private function prepareRunner()
return $this;
}

/**
* Discover Command classes.
*
* @return array|string[]
* An array with the Command classes.
*/
private function discoverCommandClasses()
{
return (new RelativeNamespaceDiscovery($this->classLoader))
->setRelativeNamespace('TaskRunner\Commands')
->setSearchPattern('/.*Commands\.php$/')
->getClasses();
}

/**
* Register commands in the runner.yml under 'commands:'.
*
Expand Down

0 comments on commit 5dc6211

Please sign in to comment.