@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * @class BaseMakeActionCommand |
60 | 60 | * @package Platine\Framework\Console |
61 | 61 | */ |
62 | -abstract class BaseMakeActionCommand extends MakeCommand |
|
63 | -{ |
|
62 | +abstract class BaseMakeActionCommand extends MakeCommand { |
|
64 | 63 | /** |
65 | 64 | * The form parameter class name |
66 | 65 | * @var class-string |
@@ -93,7 +92,7 @@ discard block |
||
93 | 92 | public function __construct( |
94 | 93 | Application $application, |
95 | 94 | Filesystem $filesystem |
96 | - ) { |
|
95 | + ) { |
|
97 | 96 | parent::__construct($application, $filesystem); |
98 | 97 | |
99 | 98 | $this->addOption( |
@@ -213,14 +212,14 @@ discard block |
||
213 | 212 | |
214 | 213 | $writer->boldYellow('Enter the properties list (empty value to finish):', true); |
215 | 214 | $value = ''; |
216 | - while ($value !== null) { |
|
215 | + while ($value !== null) { |
|
217 | 216 | $value = $io->prompt('Property full class name', null, null, false); |
218 | 217 | |
219 | - if (!empty($value)) { |
|
218 | + if (!empty($value)) { |
|
220 | 219 | $value = trim($value); |
221 | - if (!class_exists($value) && !interface_exists($value)) { |
|
220 | + if (!class_exists($value) && !interface_exists($value)) { |
|
222 | 221 | $writer->boldWhiteBgRed(sprintf('The class [%s] does not exists', $value), true); |
223 | - } else { |
|
222 | + } else { |
|
224 | 223 | $shortClass = $this->getClassBaseName($value); |
225 | 224 | $name = Str::camel($shortClass, true); |
226 | 225 | //replace"interface", "abstract" |
@@ -244,14 +243,14 @@ discard block |
||
244 | 243 | $io = $this->io(); |
245 | 244 | |
246 | 245 | $paramClass = $io->prompt('Enter the form parameter full class name', null); |
247 | - while (!class_exists($paramClass)) { |
|
246 | + while (!class_exists($paramClass)) { |
|
248 | 247 | $paramClass = $io->prompt('Class does not exists, please enter the form parameter full class name', null); |
249 | 248 | } |
250 | 249 | |
251 | 250 | $this->paramClass = $paramClass; |
252 | 251 | |
253 | 252 | $validatorClass = $io->prompt('Enter the form validator full class name', null); |
254 | - while (!class_exists($validatorClass)) { |
|
253 | + while (!class_exists($validatorClass)) { |
|
255 | 254 | $validatorClass = $io->prompt( |
256 | 255 | 'Class does not exists, please enter the form validator full class name', |
257 | 256 | null |
@@ -261,14 +260,14 @@ discard block |
||
261 | 260 | $this->validatorClass = $validatorClass; |
262 | 261 | |
263 | 262 | $entityClass = $io->prompt('Enter the entity full class name', null); |
264 | - while (!class_exists($entityClass)) { |
|
263 | + while (!class_exists($entityClass)) { |
|
265 | 264 | $entityClass = $io->prompt('Class does not exists, please enter the entity full class name', null); |
266 | 265 | } |
267 | 266 | |
268 | 267 | $this->entityClass = $entityClass; |
269 | 268 | |
270 | 269 | $repositoryClass = $io->prompt('Enter the repository full class name', null); |
271 | - while (!class_exists($repositoryClass)) { |
|
270 | + while (!class_exists($repositoryClass)) { |
|
272 | 271 | $repositoryClass = $io->prompt('Class does not exists, please enter the repository full class name', null); |
273 | 272 | } |
274 | 273 | |
@@ -284,7 +283,7 @@ discard block |
||
284 | 283 | protected function addProperty(string $value, ?string $name = null): self |
285 | 284 | { |
286 | 285 | $shortClass = $this->getClassBaseName($value); |
287 | - if ($name === null) { |
|
286 | + if ($name === null) { |
|
288 | 287 | $name = Str::camel($shortClass, true); |
289 | 288 | } |
290 | 289 | |
@@ -306,7 +305,7 @@ discard block |
||
306 | 305 | */ |
307 | 306 | protected function getPropertyName(string $value): string |
308 | 307 | { |
309 | - if (!isset($this->properties[$value])) { |
|
308 | + if (!isset($this->properties[$value])) { |
|
310 | 309 | return ''; |
311 | 310 | } |
312 | 311 | |
@@ -321,7 +320,7 @@ discard block |
||
321 | 320 | protected function getTemplatePrefix(): string |
322 | 321 | { |
323 | 322 | $templatePrefix = $this->getOptionValue('templatePrefix'); |
324 | - if ($templatePrefix === null) { |
|
323 | + if ($templatePrefix === null) { |
|
325 | 324 | $actionName = $this->getShortClassName($this->className); |
326 | 325 | $templatePrefix = Str::snake(str_ireplace('action', '', $actionName)); |
327 | 326 | } |
@@ -337,10 +336,10 @@ discard block |
||
337 | 336 | protected function getEntityContextKey(bool $isKey = true): string |
338 | 337 | { |
339 | 338 | $key = (string) $this->getOptionValue('entityContextKey'); |
340 | - if (!empty($key)) { |
|
341 | - if ($isKey) { |
|
339 | + if (!empty($key)) { |
|
340 | + if ($isKey) { |
|
342 | 341 | $key = Str::snake($key, '_'); |
343 | - } else { |
|
342 | + } else { |
|
344 | 343 | $key = Str::camel($key, true); |
345 | 344 | } |
346 | 345 | } |
@@ -355,7 +354,7 @@ discard block |
||
355 | 354 | protected function getRoutePrefix(): string |
356 | 355 | { |
357 | 356 | $routePrefix = $this->getOptionValue('routePrefix'); |
358 | - if ($routePrefix === null) { |
|
357 | + if ($routePrefix === null) { |
|
359 | 358 | $actionName = $this->getShortClassName($this->className); |
360 | 359 | $routePrefix = Str::snake(str_ireplace('action', '', $actionName)); |
361 | 360 | } |
@@ -392,7 +391,7 @@ discard block |
||
392 | 391 | protected function getMessage(string $option): ?string |
393 | 392 | { |
394 | 393 | $message = (string) $this->getOptionValue($option); |
395 | - if (!empty($message)) { |
|
394 | + if (!empty($message)) { |
|
396 | 395 | $message = addslashes($message); |
397 | 396 | } |
398 | 397 | |
@@ -424,15 +423,15 @@ discard block |
||
424 | 423 | { |
425 | 424 | $result = []; |
426 | 425 | $fields = (array) explode(',', $values); |
427 | - foreach ($fields as $field) { |
|
426 | + foreach ($fields as $field) { |
|
428 | 427 | $column = $field; |
429 | 428 | $param = $field; |
430 | 429 | $value = (array) explode(':', $field); |
431 | - if (isset($value[0])) { |
|
430 | + if (isset($value[0])) { |
|
432 | 431 | $column = $value[0]; |
433 | 432 | } |
434 | 433 | |
435 | - if (isset($value[1])) { |
|
434 | + if (isset($value[1])) { |
|
436 | 435 | $param = $value[1]; |
437 | 436 | } |
438 | 437 | |
@@ -451,23 +450,23 @@ discard block |
||
451 | 450 | protected function formatFieldStr(array $fields, bool $orderField = false): string |
452 | 451 | { |
453 | 452 | $result = ''; |
454 | - foreach ($fields as $field => $param) { |
|
455 | - if ($orderField) { |
|
453 | + foreach ($fields as $field => $param) { |
|
454 | + if ($orderField) { |
|
456 | 455 | $param = Str::upper($param); |
457 | 456 | $order = 'ASC'; |
458 | - if ($param === 'DESC') { |
|
457 | + if ($param === 'DESC') { |
|
459 | 458 | $order = 'DESC'; |
460 | 459 | } |
461 | 460 | |
462 | - if ($order === 'ASC') { |
|
461 | + if ($order === 'ASC') { |
|
463 | 462 | $result .= sprintf('\'%s\', ', $field); |
464 | - } else { |
|
463 | + } else { |
|
465 | 464 | $result .= sprintf('\'%s\' => \'DESC\', ', $field); |
466 | 465 | } |
467 | - } else { |
|
468 | - if ($field === $param) { |
|
466 | + } else { |
|
467 | + if ($field === $param) { |
|
469 | 468 | $result .= sprintf('\'%s\', ', $field); |
470 | - } else { |
|
469 | + } else { |
|
471 | 470 | $result .= sprintf('\'%s\' => \'%s\', ', $field, $param); |
472 | 471 | } |
473 | 472 | } |
@@ -483,13 +482,13 @@ discard block |
||
483 | 482 | protected function loadConfig(): void |
484 | 483 | { |
485 | 484 | $filename = $this->getOptionValue('config'); |
486 | - if (!empty($filename)) { |
|
485 | + if (!empty($filename)) { |
|
487 | 486 | $file = $this->filesystem->file($filename); |
488 | - if ($file->exists() && $file->isReadable()) { |
|
487 | + if ($file->exists() && $file->isReadable()) { |
|
489 | 488 | $content = $file->read(); |
490 | 489 | /** @var array<string, string> $config */ |
491 | 490 | $config = Json::decode($content, true); |
492 | - foreach ($config as $option => $value) { |
|
491 | + foreach ($config as $option => $value) { |
|
493 | 492 | $optionKey = Str::camel($option, true); |
494 | 493 | $this->values[$optionKey] = $value; |
495 | 494 | } |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @class PasswordGenerateCommand |
57 | 57 | * @package Platine\Framework\Console |
58 | 58 | */ |
59 | -class PasswordGenerateCommand extends Command |
|
60 | -{ |
|
59 | +class PasswordGenerateCommand extends Command { |
|
61 | 60 | /** |
62 | 61 | * The Hash instance |
63 | 62 | * @var HashInterface |
@@ -76,7 +75,7 @@ discard block |
||
76 | 75 | */ |
77 | 76 | public function __construct( |
78 | 77 | HashInterface $hash |
79 | - ) { |
|
78 | + ) { |
|
80 | 79 | parent::__construct('password:generate', 'Command to generate password'); |
81 | 80 | $this->hash = $hash; |
82 | 81 | $this->addArgument('password', 'The password to hash', null, false); |
@@ -85,8 +84,7 @@ discard block |
||
85 | 84 | /** |
86 | 85 | * {@inheritdoc} |
87 | 86 | */ |
88 | - public function execute() |
|
89 | - { |
|
87 | + public function execute() { |
|
90 | 88 | $io = $this->io(); |
91 | 89 | $writer = $io->writer(); |
92 | 90 | $password = $this->password; |
@@ -109,7 +107,7 @@ discard block |
||
109 | 107 | { |
110 | 108 | $writer->boldYellow('GENERATION OF PASSWORD', true)->eol(); |
111 | 109 | $password = $this->getArgumentValue('password'); |
112 | - if (empty($password)) { |
|
110 | + if (empty($password)) { |
|
113 | 111 | $io = $this->io(); |
114 | 112 | $password = $io->prompt('Enter the plain password to generate', ''); |
115 | 113 | } |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | * @class ServerRequestUrlGenerator |
55 | 55 | * @package Platine\Framework\Pagination |
56 | 56 | */ |
57 | -class ServerRequestUrlGenerator implements UrlGeneratorInterface |
|
58 | -{ |
|
57 | +class ServerRequestUrlGenerator implements UrlGeneratorInterface { |
|
59 | 58 | /** |
60 | 59 | * The server request instance |
61 | 60 | * @var ServerRequestInterface |
@@ -79,8 +78,7 @@ discard block |
||
79 | 78 | * @param ServerRequestInterface $request |
80 | 79 | * @param string $queryName |
81 | 80 | */ |
82 | - public function __construct(ServerRequestInterface $request, string $queryName) |
|
83 | - { |
|
81 | + public function __construct(ServerRequestInterface $request, string $queryName) { |
|
84 | 82 | $this->request = $request; |
85 | 83 | $this->queryVarName = $queryName; |
86 | 84 | |
@@ -114,18 +112,18 @@ discard block |
||
114 | 112 | $page = $this->queryVarName; |
115 | 113 | |
116 | 114 | $query = ''; |
117 | - if (empty($queryString)) { |
|
115 | + if (empty($queryString)) { |
|
118 | 116 | $query = sprintf('?%s={num}', $page); |
119 | - } else { |
|
117 | + } else { |
|
120 | 118 | $parts = explode($page . '=', $queryString); |
121 | 119 | $count = count($parts); |
122 | 120 | |
123 | - if ($count === 1) { |
|
121 | + if ($count === 1) { |
|
124 | 122 | $query = sprintf('?%s&%s={num}', $queryString, $page); |
125 | - } else { |
|
126 | - if (empty($parts[0])) { |
|
123 | + } else { |
|
124 | + if (empty($parts[0])) { |
|
127 | 125 | $query = sprintf('?%s={num}', $page); |
128 | - } else { |
|
126 | + } else { |
|
129 | 127 | $query = sprintf('?%s%s={num}', $parts[0], $page); |
130 | 128 | } |
131 | 129 | } |
@@ -79,8 +79,8 @@ |
||
79 | 79 | foreach ($pages as $page) { |
80 | 80 | if ($page->getUrl() !== null) { |
81 | 81 | $html .= '<li class = "page-item' . ($page->isCurrent() ? ' active"' : '"') |
82 | - . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
83 | - . $page->getNumber() . '</a></li>'; |
|
82 | + . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
83 | + . $page->getNumber() . '</a></li>'; |
|
84 | 84 | } else { |
85 | 85 | $html .= '<li class = "page-item disabled"><a href="#" class="page-link">' |
86 | 86 | . $page->getNumber() . '</a></li>'; |
@@ -54,20 +54,19 @@ discard block |
||
54 | 54 | * @class BootstrapRenderer |
55 | 55 | * @package Platine\Framework\Pagination |
56 | 56 | */ |
57 | -class BootstrapRenderer implements RendererInterface |
|
58 | -{ |
|
57 | +class BootstrapRenderer implements RendererInterface { |
|
59 | 58 | /** |
60 | 59 | * {@inheritdoc} |
61 | 60 | */ |
62 | 61 | public function render(Pagination $pagination): string |
63 | 62 | { |
64 | - if ($pagination->getTotalPages() <= 1) { |
|
63 | + if ($pagination->getTotalPages() <= 1) { |
|
65 | 64 | return ''; |
66 | 65 | } |
67 | 66 | |
68 | 67 | $html = '<ul class = "pagination">'; |
69 | 68 | |
70 | - if ($pagination->hasPreviousPage()) { |
|
69 | + if ($pagination->hasPreviousPage()) { |
|
71 | 70 | $html .= '<li class = "page-item"><a href = "' |
72 | 71 | . $pagination->getPreviousUrl() . '" class="page-link">« ' |
73 | 72 | . $pagination->getPreviousText() . '</a></li>'; |
@@ -76,18 +75,18 @@ discard block |
||
76 | 75 | /** @var array<\Platine\Pagination\Page> $pages */ |
77 | 76 | $pages = $pagination->getPages(); |
78 | 77 | |
79 | - foreach ($pages as $page) { |
|
80 | - if ($page->getUrl() !== null) { |
|
78 | + foreach ($pages as $page) { |
|
79 | + if ($page->getUrl() !== null) { |
|
81 | 80 | $html .= '<li class = "page-item' . ($page->isCurrent() ? ' active"' : '"') |
82 | 81 | . '><a href = "' . $page->getUrl() . '" class="page-link">' |
83 | 82 | . $page->getNumber() . '</a></li>'; |
84 | - } else { |
|
83 | + } else { |
|
85 | 84 | $html .= '<li class = "page-item disabled"><a href="#" class="page-link">' |
86 | 85 | . $page->getNumber() . '</a></li>'; |
87 | 86 | } |
88 | 87 | } |
89 | 88 | |
90 | - if ($pagination->hasNextPage()) { |
|
89 | + if ($pagination->hasNextPage()) { |
|
91 | 90 | $html .= '<li class = "page-item"><a href = "' |
92 | 91 | . $pagination->getNextUrl() . '" class="page-link">' |
93 | 92 | . $pagination->getNextText() . ' »</a></li>'; |
@@ -150,8 +150,8 @@ |
||
150 | 150 | $task->run(); |
151 | 151 | } catch (Throwable $e) { |
152 | 152 | $this->logger->error('Error occurred when execute task {task}, error: {error}', [ |
153 | - 'task' => $task->name(), |
|
154 | - 'error' => $e->getMessage() |
|
153 | + 'task' => $task->name(), |
|
154 | + 'error' => $e->getMessage() |
|
155 | 155 | ]); |
156 | 156 | } |
157 | 157 | } |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @class Scheduler |
57 | 57 | * @package Platine\Framework\Task |
58 | 58 | */ |
59 | -class Scheduler implements SchedulerInterface |
|
60 | -{ |
|
59 | +class Scheduler implements SchedulerInterface { |
|
61 | 60 | /** |
62 | 61 | * The logger instance |
63 | 62 | * @var LoggerInterface |
@@ -76,7 +75,7 @@ discard block |
||
76 | 75 | */ |
77 | 76 | public function __construct( |
78 | 77 | LoggerInterface $logger |
79 | - ) { |
|
78 | + ) { |
|
80 | 79 | $this->logger = $logger; |
81 | 80 | } |
82 | 81 | |
@@ -87,8 +86,8 @@ discard block |
||
87 | 86 | { |
88 | 87 | $datetime = new DateTime(); |
89 | 88 | $tasks = $this->tasks; |
90 | - foreach ($tasks as $task) { |
|
91 | - if ($this->isDue($task, $datetime)) { |
|
89 | + foreach ($tasks as $task) { |
|
90 | + if ($this->isDue($task, $datetime)) { |
|
92 | 91 | $this->execute($task); |
93 | 92 | } |
94 | 93 | } |
@@ -100,7 +99,7 @@ discard block |
||
100 | 99 | public function add(TaskInterface $task): void |
101 | 100 | { |
102 | 101 | $key = $task->name(); |
103 | - if (array_key_exists($key, $this->tasks)) { |
|
102 | + if (array_key_exists($key, $this->tasks)) { |
|
104 | 103 | throw new RuntimeException(sprintf('Task [%s] already exist', $key)); |
105 | 104 | } |
106 | 105 | $this->tasks[$key] = $task; |
@@ -146,9 +145,9 @@ discard block |
||
146 | 145 | public function execute(TaskInterface $task): void |
147 | 146 | { |
148 | 147 | $this->logger->info('Execute task {task}', ['task' => $task->name()]); |
149 | - try { |
|
148 | + try { |
|
150 | 149 | $task->run(); |
151 | - } catch (Throwable $e) { |
|
150 | + } catch (Throwable $e) { |
|
152 | 151 | $this->logger->error('Error occurred when execute task {task}, error: {error}', [ |
153 | 152 | 'task' => $task->name(), |
154 | 153 | 'error' => $e->getMessage() |
@@ -51,8 +51,7 @@ |
||
51 | 51 | * @class SchedulerInterface |
52 | 52 | * @package Platine\Framework\Task |
53 | 53 | */ |
54 | -interface SchedulerInterface |
|
55 | -{ |
|
54 | +interface SchedulerInterface { |
|
56 | 55 | /** |
57 | 56 | * Execute the scheduler |
58 | 57 | * @return void |
@@ -73,7 +73,7 @@ |
||
73 | 73 | parent::__construct($scheduler, $application, $config); |
74 | 74 | |
75 | 75 | $this->setName('scheduler:run') |
76 | - ->setDescription('Execute the scheduled tasks'); |
|
76 | + ->setDescription('Execute the scheduled tasks'); |
|
77 | 77 | |
78 | 78 | $this->addArgument('name', 'the name of task to execute instead of all', null, false, true); |
79 | 79 | } |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | * @template T |
58 | 58 | * @extends AbstractCommand<T> |
59 | 59 | */ |
60 | -class SchedulerRunCommand extends AbstractCommand |
|
61 | -{ |
|
60 | +class SchedulerRunCommand extends AbstractCommand { |
|
62 | 61 | /** |
63 | 62 | * Create new instance |
64 | 63 | * @param SchedulerInterface $scheduler |
@@ -69,7 +68,7 @@ discard block |
||
69 | 68 | SchedulerInterface $scheduler, |
70 | 69 | Application $application, |
71 | 70 | Config $config |
72 | - ) { |
|
71 | + ) { |
|
73 | 72 | parent::__construct($scheduler, $application, $config); |
74 | 73 | |
75 | 74 | $this->setName('scheduler:run') |
@@ -81,15 +80,14 @@ discard block |
||
81 | 80 | /** |
82 | 81 | * {@inheritdoc} |
83 | 82 | */ |
84 | - public function execute() |
|
85 | - { |
|
83 | + public function execute() { |
|
86 | 84 | //Load the task |
87 | 85 | $this->loadTasks(); |
88 | 86 | |
89 | 87 | $name = $this->getArgumentValue('name'); |
90 | - if (!empty($name)) { |
|
88 | + if (!empty($name)) { |
|
91 | 89 | $task = $this->scheduler->get($name); |
92 | - if ($task !== null) { |
|
90 | + if ($task !== null) { |
|
93 | 91 | $this->scheduler->execute($task); |
94 | 92 | return; |
95 | 93 | } |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * @package Platine\Framework\Task\Command |
60 | 60 | * @template T |
61 | 61 | */ |
62 | -abstract class AbstractCommand extends Command |
|
63 | -{ |
|
62 | +abstract class AbstractCommand extends Command { |
|
64 | 63 | /** |
65 | 64 | * The scheduler instance |
66 | 65 | * @var SchedulerInterface |
@@ -89,7 +88,7 @@ discard block |
||
89 | 88 | SchedulerInterface $scheduler, |
90 | 89 | Application $application, |
91 | 90 | Config $config |
92 | - ) { |
|
91 | + ) { |
|
93 | 92 | parent::__construct('scheduler', 'Command to manage scheduler tasks'); |
94 | 93 | $this->scheduler = $scheduler; |
95 | 94 | $this->application = $application; |
@@ -103,7 +102,7 @@ discard block |
||
103 | 102 | */ |
104 | 103 | protected function addTask($task): void |
105 | 104 | { |
106 | - if (is_string($task)) { |
|
105 | + if (is_string($task)) { |
|
107 | 106 | $task = $this->createTask($task); |
108 | 107 | } |
109 | 108 | |
@@ -118,7 +117,7 @@ discard block |
||
118 | 117 | { |
119 | 118 | /** @var string[] $tasks */ |
120 | 119 | $tasks = $this->config->get('tasks', []); |
121 | - foreach ($tasks as $task) { |
|
120 | + foreach ($tasks as $task) { |
|
122 | 121 | $this->addTask($task); |
123 | 122 | } |
124 | 123 | } |
@@ -130,11 +129,11 @@ discard block |
||
130 | 129 | */ |
131 | 130 | protected function createTask(string $task): TaskInterface |
132 | 131 | { |
133 | - if ($this->application->has($task)) { |
|
132 | + if ($this->application->has($task)) { |
|
134 | 133 | return $this->application->get($task); |
135 | 134 | } |
136 | 135 | |
137 | - if (class_exists($task)) { |
|
136 | + if (class_exists($task)) { |
|
138 | 137 | /** @var TaskInterface $o */ |
139 | 138 | $o = new $task(); |
140 | 139 | return $o; |
@@ -157,7 +156,7 @@ discard block |
||
157 | 156 | //Load providers tasks |
158 | 157 | /** @var class-string[] $tasks */ |
159 | 158 | $tasks = $this->application->getProvidersTasks(); |
160 | - foreach ($tasks as $task) { |
|
159 | + foreach ($tasks as $task) { |
|
161 | 160 | $this->addTask($task); |
162 | 161 | } |
163 | 162 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | parent::__construct($scheduler, $application, $config); |
76 | 76 | |
77 | 77 | $this->setName('scheduler:list') |
78 | - ->setDescription('Show the list of scheduled tasks'); |
|
78 | + ->setDescription('Show the list of scheduled tasks'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | * @template T |
60 | 60 | * @extends AbstractCommand<T> |
61 | 61 | */ |
62 | -class SchedulerListCommand extends AbstractCommand |
|
63 | -{ |
|
62 | +class SchedulerListCommand extends AbstractCommand { |
|
64 | 63 | /** |
65 | 64 | * Create new instance |
66 | 65 | * @param SchedulerInterface $scheduler |
@@ -71,7 +70,7 @@ discard block |
||
71 | 70 | SchedulerInterface $scheduler, |
72 | 71 | Application $application, |
73 | 72 | Config $config |
74 | - ) { |
|
73 | + ) { |
|
75 | 74 | parent::__construct($scheduler, $application, $config); |
76 | 75 | |
77 | 76 | $this->setName('scheduler:list') |
@@ -81,8 +80,7 @@ discard block |
||
81 | 80 | /** |
82 | 81 | * {@inheritdoc} |
83 | 82 | */ |
84 | - public function execute() |
|
85 | - { |
|
83 | + public function execute() { |
|
86 | 84 | //Load the task list |
87 | 85 | $this->loadTasks(); |
88 | 86 | |
@@ -102,7 +100,7 @@ discard block |
||
102 | 100 | $tasks = $this->scheduler->all(); |
103 | 101 | |
104 | 102 | $rows = []; |
105 | - foreach ($tasks as $task) { |
|
103 | + foreach ($tasks as $task) { |
|
106 | 104 | $nextExecution = date('Y-m-d H:i', Cron::parse($task->expression())); |
107 | 105 | $rows[] = [ |
108 | 106 | 'name' => $task->name(), |