From cb2150cdd259e76bab6fb40a18a5afc506313008 Mon Sep 17 00:00:00 2001 From: brendt Date: Sun, 26 May 2024 06:38:40 +0200 Subject: [PATCH] Tail improvements --- src/Commands/TailCommand.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Commands/TailCommand.php b/src/Commands/TailCommand.php index f998a28..4f1b8b6 100644 --- a/src/Commands/TailCommand.php +++ b/src/Commands/TailCommand.php @@ -14,30 +14,31 @@ public function __construct( private TailDebugLogCommand $tailDebugLogCommand, private TailProjectLogCommand $tailProjectLogCommand, private TailServerLogCommand $tailServerLogCommand, - ) { - } + ) {} #[ConsoleCommand( name: 'tail', description: 'Tail multiple logs', )] public function __invoke( - #[ConsoleArgument(description: 'Include the debug log', aliases: ['-d'])] - ?bool $debug = null, #[ConsoleArgument(description: 'Include the project log', aliases: ['-p'])] ?bool $project = null, #[ConsoleArgument(description: 'Include the server log', aliases: ['-s'])] - ?bool $server = null - ): void { - $shouldFilter = $debug !== null - || $project !== null - || $server !== null; + ?bool $server = null, + #[ConsoleArgument(description: 'Include the debug log', aliases: ['-d'])] + ?bool $debug = null, + ): void + { + $shouldFilter = + $project !== null + || $server !== null + || $debug !== null; /** @var array $loggers */ $loggers = array_filter([ - ($shouldFilter === false || $debug) ? $this->tailDebugLogCommand : null, ($shouldFilter === false || $project) ? $this->tailProjectLogCommand : null, ($shouldFilter === false || $server) ? $this->tailServerLogCommand : null, + ($shouldFilter === false || $debug) ? $this->tailDebugLogCommand : null, ]); /** @var Fiber[] $fibers */