Skip to content

Commit

Permalink
Deprecated usage of setInput() (#4433)
Browse files Browse the repository at this point in the history
* DX-4994: Deprecated usage of setInput()

* createDefaultContainer is deprecated

* fix container

* fix it right

* grr
  • Loading branch information
danepowell authored Nov 30, 2021
1 parent c8a388d commit 11fa6fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/Robo/Blt.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Composer\Autoload\ClassLoader;
use Composer\InstalledVersions;
use Consolidation\AnnotatedCommand\CommandFileDiscovery;
use League\Container\Container;
use League\Container\ContainerAwareInterface;
use League\Container\ContainerAwareTrait;
use League\Container\Definition\DefinitionInterface;
Expand Down Expand Up @@ -75,8 +76,11 @@ public function __construct(

$this->setConfig($config);
$application = new Application('BLT', Blt::getVersion());
$container = Robo::createDefaultContainer($input, $output, $application,
$config, $classLoader);
$container = new Container();
Robo::configureContainer($container, $application, $config, $input, $output, $classLoader);
if (!self::usingLegacyContainer()) {
Robo::finalizeContainer($container);
}
$this->setContainer($container);
$this->addDefaultArgumentsAndOptions($application);
$this->configureContainer($container);
Expand Down
3 changes: 0 additions & 3 deletions src/Robo/Tasks/DrushTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ public function run() {
throw new TaskException($this, 'You must add at least one command');
}

// Set $input to NULL so that it is not inherited by the process.
$this->setInput(NULL);

// If 'stopOnFail' is not set, or if there is only one command to run,
// then execute the single command to run.
if (!$this->stopOnFail || (count($this->exec) == 1)) {
Expand Down
1 change: 0 additions & 1 deletion src/Robo/Tasks/LoadTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ trait LoadTasks {
protected function taskDrush() {
/** @var \Acquia\Blt\Robo\Tasks\DrushTask $task */
$task = $this->task(DrushTask::class);
$task->setInput($this->input());
/** @var \Symfony\Component\Console\Output\OutputInterface $output */
$output = $this->output();
$task->setVerbosityThreshold($output->getVerbosity());
Expand Down

0 comments on commit 11fa6fb

Please sign in to comment.