Skip to content

Commit b9ded5f

Browse files
committed
chore: refactor tap() calls
1 parent d9cb08a commit b9ded5f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/Commands/BuildCommand.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ private function compile(string $name): BuildCommand
141141
/** @phpstan-ignore-next-line This is an instance of `ConsoleOutputInterface` */
142142
$section = tap($this->originalOutput->section())->write('');
143143

144-
$progressBar = tap(
145-
new ProgressBar(
146-
$this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL ? new NullOutput : $section, 25
147-
)
148-
)->setProgressCharacter("\xF0\x9F\x8D\xBA");
144+
$progressBar = new ProgressBar(
145+
$this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL ? new NullOutput : $section, 25
146+
);
147+
148+
$progressBar->setProgressCharacter("\xF0\x9F\x8D\xBA");
149+
150+
$process->start();
149151

150-
foreach (tap($process)->start() as $type => $data) {
152+
foreach ($process as $type => $data) {
151153
$progressBar->advance();
152154

153155
if ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {

src/Commands/InstallCommand.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace LaravelZero\Framework\Commands;
1515

1616
use LaravelZero\Framework\Components;
17+
use LaravelZero\Framework\Components\AbstractInstaller;
1718
use Symfony\Component\Console\Input\ArrayInput;
1819

1920
final class InstallCommand extends Command
@@ -46,9 +47,6 @@ final class InstallCommand extends Command
4647
'view' => Components\View\Installer::class,
4748
];
4849

49-
/**
50-
* {@inheritdoc}
51-
*/
5250
public function handle()
5351
{
5452
$title = 'Laravel Zero - Component installer';
@@ -63,7 +61,10 @@ public function handle()
6361
}
6462

6563
if ($option !== null && ! empty($this->componentInstallers[$option])) {
66-
$command = tap($this->app[$this->componentInstallers[$option]])->setLaravel($this->app);
64+
/** @var AbstractInstaller $command */
65+
$command = $this->app[$this->componentInstallers[$option]];
66+
67+
$command->setLaravel($this->app);
6768

6869
$command->setApplication($this->getApplication());
6970

0 commit comments

Comments
 (0)