![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/orchestra/workbench/src/Console/ |
<?php namespace Orchestra\Workbench\Console; use Illuminate\Console\Command; use Illuminate\Contracts\Console\Kernel as ConsoleKernel; use Illuminate\Support\Collection; use Orchestra\Workbench\Contracts\RecipeManager; use Orchestra\Workbench\Workbench; use Symfony\Component\Console\Attribute\AsCommand; /** * @phpstan-import-type TWorkbenchConfig from \Orchestra\Testbench\Foundation\Config */ #[AsCommand(name: 'workbench:build', description: 'Run builds for workbench')] class BuildCommand extends Command { /** * Execute the console command. * * @return int */ public function handle(ConsoleKernel $kernel, RecipeManager $recipes) { $commands = Collection::make($kernel->all()) ->keys() ->filter(static function ($command) { return \is_string($command); })->mapWithKeys(static function (string $command) { return [str_replace(':', '-', $command) => $command]; }); /** @var array<int, string> $build */ $build = Workbench::config('build'); Collection::make($build) ->each(function (string $build) use ($kernel, $recipes, $commands) { if ($recipes->hasCommand($build)) { $recipes->command($build)->handle($kernel, $this->output); return; } $command = $commands->get($build) ?? $commands->first(static function ($name) use ($build) { return $build === $name; }); if (! \is_null($command)) { $recipes->commandUsing($command)->handle($kernel, $this->output); } }); return Command::SUCCESS; } }