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(); } diff --git a/src/Roots/Acorn/Console/Commands/OptimizeCommand.php b/src/Roots/Acorn/Console/Commands/OptimizeCommand.php index 538353fa..08fd5031 100644 --- a/src/Roots/Acorn/Console/Commands/OptimizeCommand.php +++ b/src/Roots/Acorn/Console/Commands/OptimizeCommand.php @@ -18,12 +18,9 @@ public function handle() { $this->components->info('Caching framework bootstrap, configuration, and metadata.'); - collect([ - 'config' => fn () => $this->gracefulCallSilent('config:cache') == 0, - 'events' => fn () => $this->gracefulCallSilent('event:cache') == 0, - 'routes' => fn () => $this->gracefulCallSilent('route:cache') == 0, - 'views' => fn () => $this->gracefulCallSilent('view:cache') == 0, - ])->each(fn ($task, $description) => $this->components->task($description, $task)); + foreach ($this->getOptimizeTasks() as $description => $command) { + $this->components->task($description, fn () => $this->gracefulCallSilent($command) == 0); + } $this->newLine(); }