From 6b130eca6b7d44af0b02bac772858f6a0c8450e1 Mon Sep 17 00:00:00 2001 From: Brandon <brandon@tendency.me> Date: Mon, 23 Dec 2024 19:40:57 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Use=20`Opti?= =?UTF-8?q?mizeClearCommand::getOptimizeClearTasks`=20when=20getting=20`op?= =?UTF-8?q?timize:clear`=20tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Acorn/Console/Commands/OptimizeClearCommand.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Roots/Acorn/Console/Commands/OptimizeClearCommand.php b/src/Roots/Acorn/Console/Commands/OptimizeClearCommand.php index 4ded4994..e127c114 100644 --- a/src/Roots/Acorn/Console/Commands/OptimizeClearCommand.php +++ b/src/Roots/Acorn/Console/Commands/OptimizeClearCommand.php @@ -18,14 +18,9 @@ public function handle() { $this->components->info('Clearing cached bootstrap files.'); - collect([ - 'cache' => fn () => $this->gracefulCallSilent('cache:clear') == 0, - 'compiled' => fn () => $this->gracefulCallSilent('clear-compiled') == 0, - 'config' => fn () => $this->gracefulCallSilent('config:clear') == 0, - 'events' => fn () => $this->gracefulCallSilent('event:clear') == 0, - 'routes' => fn () => $this->gracefulCallSilent('route:clear') == 0, - 'views' => fn () => $this->gracefulCallSilent('view:clear') == 0, - ])->each(fn ($task, $description) => $this->components->task($description, $task)); + foreach ($this->getOptimizeClearTasks() as $description => $command) { + $this->components->task($description, fn () => $this->gracefulCallSilent($command) == 0); + } $this->newLine(); }