@@ -163,7 +163,7 @@ |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // Order Tasks |
| 166 | - usort($tasks, function ($a, $b) use ($orderBy) { |
|
| 166 | + usort($tasks, function($a, $b) use ($orderBy) { |
|
| 167 | 167 | $aValue = $a[$orderBy]; |
| 168 | 168 | $bValue = $b[$orderBy]; |
| 169 | 169 | |
@@ -167,7 +167,9 @@ |
||
| 167 | 167 | $aValue = $a[$orderBy]; |
| 168 | 168 | $bValue = $b[$orderBy]; |
| 169 | 169 | |
| 170 | - if ($aValue === $bValue) return 0; |
|
| 170 | + if ($aValue === $bValue) { |
|
| 171 | + return 0; |
|
| 172 | + } |
|
| 171 | 173 | |
| 172 | 174 | return $aValue < $bValue ? -1 : 1; |
| 173 | 175 | }); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $this->rewind(); |
| 35 | - for ($i=0; $i<$key; $i++) { |
|
| 35 | + for ($i = 0; $i < $key; $i++) { |
|
| 36 | 36 | $this->next(); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -42,11 +42,11 @@ |
||
| 42 | 42 | ->setName('list') |
| 43 | 43 | ->setDescription('Lists tasks') |
| 44 | 44 | ->addOption('profile', 'p', InputOption::VALUE_OPTIONAL, 'Limits the listing to a profile') |
| 45 | - ->addOption('status', 's', InputOption::VALUE_OPTIONAL, 'Limits the listing to a status') |
|
| 46 | - ->addOption('tags', 't', InputOption::VALUE_IS_ARRAY|InputOption::VALUE_OPTIONAL, 'Limits the listing to one or many (array) tags') |
|
| 47 | - ->addOption('order', 'o', InputOption::VALUE_REQUIRED, 'Orders tasks by "date", "profile" or "status"', 'status') |
|
| 48 | - ->addOption('follow', 'f', InputOption::VALUE_NONE, 'Enables to keep tasks evolution on the console') |
|
| 49 | - ->addOption('legend', 'l', InputOption::VALUE_NONE, 'Displays a legend for status labels at the list footer') |
|
| 45 | + ->addOption('status', 's', InputOption::VALUE_OPTIONAL, 'Limits the listing to a status') |
|
| 46 | + ->addOption('tags', 't', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Limits the listing to one or many (array) tags') |
|
| 47 | + ->addOption('order', 'o', InputOption::VALUE_REQUIRED, 'Orders tasks by "date", "profile" or "status"', 'status') |
|
| 48 | + ->addOption('follow', 'f', InputOption::VALUE_NONE, 'Enables to keep tasks evolution on the console') |
|
| 49 | + ->addOption('legend', 'l', InputOption::VALUE_NONE, 'Displays a legend for status labels at the list footer') |
|
| 50 | 50 | ; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -145,7 +145,9 @@ |
||
| 145 | 145 | // When no specific status is required in the command line, |
| 146 | 146 | // then do not display `finished` tasks (this is arbitrary) |
| 147 | 147 | if (is_null($this->status)) { |
| 148 | - if (Status::FINISHED === $status) continue; |
|
| 148 | + if (Status::FINISHED === $status) { |
|
| 149 | + continue; |
|
| 150 | + } |
|
| 149 | 151 | } |
| 150 | 152 | |
| 151 | 153 | $profile = (string) $task->getProfile(); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | ->addArgument('profile', InputArgument::REQUIRED, 'Profile name') |
| 25 | 25 | ->addArgument('job', InputArgument::REQUIRED, 'Job class name') |
| 26 | 26 | ->addArgument('parameters', InputArgument::IS_ARRAY, 'List of parameters (key:value)', []) |
| 27 | - ->addOption('tags', 't', InputOption::VALUE_IS_ARRAY|InputOption::VALUE_OPTIONAL, 'Add one or multiple (array) tags') |
|
| 27 | + ->addOption('tags', 't', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Add one or multiple (array) tags') |
|
| 28 | 28 | ; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public static function create(): Dispatcher |
| 17 | 17 | { |
| 18 | - return cachedDispatcher(function (RouteCollector $r) |
|
| 18 | + return cachedDispatcher(function(RouteCollector $r) |
|
| 19 | 19 | { |
| 20 | - $r->get( '/tasks', ListTasks::class ); |
|
| 21 | - $r->post( '/tasks', AddTask::class ); |
|
| 22 | - $r->get( '/task/{identifier}', ShowTask::class ); |
|
| 20 | + $r->get('/tasks', ListTasks::class); |
|
| 21 | + $r->post('/tasks', AddTask::class); |
|
| 22 | + $r->get('/task/{identifier}', ShowTask::class); |
|
| 23 | 23 | |
| 24 | 24 | }, [ |
| 25 | 25 | 'cacheFile' => self::getRoutingCachePath(), |