Skip to content

Commit 2cb8d9b

Browse files
authored
Optimize the code for setting input and output (#5934)
1 parent c6b6941 commit 2cb8d9b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/AsCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ public function handle()
3939
$instance = $this->container->get($this->class);
4040

4141
if (in_array(InteractsWithIO::class, class_uses_recursive($this->class))) {
42-
(function ($input, $output) {
43-
$this->input = $input;
44-
$this->output = $output;
45-
})->call($instance, $this->input, $this->output);
42+
$instance->setInput($this->input);
43+
$instance->setOutput($this->output);
4644
}
4745

4846
return (fn ($method) => $this->{$method}(...$parameters))->call($instance, $this->method);

0 commit comments

Comments
 (0)