@@ -5,9 +5,9 @@ |
||
| 5 | 5 | final class Status |
| 6 | 6 | { |
| 7 | 7 | const WAITING = 'waiting', |
| 8 | - RUNNING = 'running', |
|
| 9 | - FINISHED = 'finished', |
|
| 10 | - FAILED = 'failed'; |
|
| 8 | + RUNNING = 'running', |
|
| 9 | + FINISHED = 'finished', |
|
| 10 | + FAILED = 'failed'; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * |
@@ -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 | }); |
@@ -37,13 +37,11 @@ |
||
| 37 | 37 | private $createdAt; |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - |
|
| 41 | 40 | * @var ParameterBag |
| 42 | 41 | */ |
| 43 | 42 | private $parameters; |
| 44 | 43 | |
| 45 | 44 | /** |
| 46 | - |
|
| 47 | 45 | * @var TagBag |
| 48 | 46 | */ |
| 49 | 47 | private $tags; |
@@ -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 | |
@@ -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(), |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | private $eventDispatcher; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - |
|
| 28 | 27 | * @param Queue $queue |
| 29 | 28 | * @param EventDispatcherInterface $eventDispatcher |
| 30 | 29 | */ |