@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | $ignoreErrors = []; |
4 | 4 | $ignoreErrors[] = [ |
@@ -42,4 +42,4 @@ |
||
42 | 42 | $reporters->add('coverage', $coverage); |
43 | 43 | }); |
44 | 44 | |
45 | -require_once realpath(rtrim(getcwd(), '\\/ ')).DIRECTORY_SEPARATOR.'spec'.DIRECTORY_SEPARATOR.'bootstrap.php'; |
|
45 | +require_once realpath(rtrim(getcwd(), '\\/ ')) . DIRECTORY_SEPARATOR . 'spec' . DIRECTORY_SEPARATOR . 'bootstrap.php'; |
@@ -99,7 +99,7 @@ |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | // Si nous ne le faisons pas correspondre, recommencez les itérations |
102 | - if (! $satisfied) { |
|
102 | + if (!$satisfied) { |
|
103 | 103 | $next = $this->increment($next, $position); |
104 | 104 | |
105 | 105 | continue 2; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * Enregistrez toutes les tâches dans cette méthode pour l'application. |
39 | 39 | * Appelé par TaskRunner. |
40 | 40 | */ |
41 | - 'init' => function (Scheduler $schedule) { |
|
41 | + 'init' => function(Scheduler $schedule) { |
|
42 | 42 | $schedule->command('foo:bar')->daily(); |
43 | 43 | |
44 | 44 | $schedule->shell('cp foo bar')->daily('11:00 pm'); |
@@ -144,7 +144,7 @@ |
||
144 | 144 | if (str_contains($time, '/')) { |
145 | 145 | $period = substr($time, strpos($time, '/') + 1) ?: ''; |
146 | 146 | |
147 | - if ($period === '' || ! ctype_digit($period)) { |
|
147 | + if ($period === '' || !ctype_digit($period)) { |
|
148 | 148 | throw TasksException::invalidCronExpression($this->currentExpression); |
149 | 149 | } |
150 | 150 |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | |
59 | 59 | foreach ($tasks as $task) { |
60 | 60 | // Si des tâches spécifiques ont été choisies, sauter l'exécution des tâches restantes. |
61 | - if (! empty($this->only) && ! in_array($task->name, $this->only, true)) { |
|
61 | + if (!empty($this->only) && !in_array($task->name, $this->only, true)) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | - if (! $task->shouldRun($this->testTime) && empty($this->only)) { |
|
65 | + if (!$task->shouldRun($this->testTime) && empty($this->only)) { |
|
66 | 66 | continue; |
67 | 67 | } |
68 | 68 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | - if (! is_cli()) { |
|
133 | + if (!is_cli()) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $min = $hour = 0; |
77 | 77 | |
78 | - if (! empty($time)) { |
|
78 | + if (!empty($time)) { |
|
79 | 79 | [$min, $hour] = $this->parseTime($time); |
80 | 80 | } |
81 | 81 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function everyOddHour($minute = null): self |
180 | 180 | { |
181 | - $this->expression['min'] = $minute ?? '0'; |
|
181 | + $this->expression['min'] = $minute ?? '0'; |
|
182 | 182 | $this->expression['hour'] = '1-23/2'; |
183 | 183 | |
184 | 184 | return $this; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function hours($hours = []): self |
203 | 203 | { |
204 | - if (! is_array($hours)) { |
|
204 | + if (!is_array($hours)) { |
|
205 | 205 | $hours = [$hours]; |
206 | 206 | } |
207 | 207 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function minutes($minutes = []): self |
297 | 297 | { |
298 | - if (! is_array($minutes)) { |
|
298 | + if (!is_array($minutes)) { |
|
299 | 299 | $minutes = [$minutes]; |
300 | 300 | } |
301 | 301 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function days($days): self |
313 | 313 | { |
314 | - if (! is_array($days)) { |
|
314 | + if (!is_array($days)) { |
|
315 | 315 | $days = [$days]; |
316 | 316 | } |
317 | 317 | |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | { |
394 | 394 | $min = $hour = 0; |
395 | 395 | |
396 | - if (! empty($time)) { |
|
396 | + if (!empty($time)) { |
|
397 | 397 | [$min, $hour] = $this->parseTime($time); |
398 | 398 | } |
399 | 399 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | */ |
412 | 412 | public function daysOfMonth($days): self |
413 | 413 | { |
414 | - if (! is_array($days)) { |
|
414 | + if (!is_array($days)) { |
|
415 | 415 | $days = [$days]; |
416 | 416 | } |
417 | 417 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | { |
484 | 484 | $min = $hour = 0; |
485 | 485 | |
486 | - if (! empty($time)) { |
|
486 | + if (!empty($time)) { |
|
487 | 487 | [$min, $hour] = $this->parseTime($time); |
488 | 488 | } |
489 | 489 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | { |
514 | 514 | $min = $hour = 0; |
515 | 515 | |
516 | - if (! empty($time)) { |
|
516 | + if (!empty($time)) { |
|
517 | 517 | [$min, $hour] = $this->parseTime($time); |
518 | 518 | } |
519 | 519 | |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | { |
533 | 533 | $min = $hour = 0; |
534 | 534 | |
535 | - if (! empty($time)) { |
|
535 | + if (!empty($time)) { |
|
536 | 536 | [$min, $hour] = $this->parseTime($time); |
537 | 537 | } |
538 | 538 | |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | { |
551 | 551 | $min = $hour = 0; |
552 | 552 | |
553 | - if (! empty($time)) { |
|
553 | + if (!empty($time)) { |
|
554 | 554 | [$min, $hour] = $this->parseTime($time); |
555 | 555 | } |
556 | 556 | |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | { |
569 | 569 | $min = $hour = '*'; |
570 | 570 | |
571 | - if (! empty($time)) { |
|
571 | + if (!empty($time)) { |
|
572 | 572 | [$min, $hour] = $this->parseTime($time); |
573 | 573 | } |
574 | 574 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $addresses = Arr::wrap($addresses); |
93 | 93 | |
94 | - return $this->then(function (MailerInterface $mailer) use ($addresses, $onlyIfOutputExists) { |
|
94 | + return $this->then(function(MailerInterface $mailer) use ($addresses, $onlyIfOutputExists) { |
|
95 | 95 | $this->emailOutput($mailer, $addresses, $onlyIfOutputExists); |
96 | 96 | }); |
97 | 97 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $addresses = Arr::wrap($addresses); |
121 | 121 | |
122 | - return $this->onFailure(function (MailerInterface $mailer) use ($addresses) { |
|
122 | + return $this->onFailure(function(MailerInterface $mailer) use ($addresses) { |
|
123 | 123 | $this->emailOutput($mailer, $addresses, false); |
124 | 124 | }); |
125 | 125 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function onSuccess(Closure $callback): self |
159 | 159 | { |
160 | - return $this->then(function (ContainerInterface $container) use ($callback) { |
|
160 | + return $this->then(function(ContainerInterface $container) use ($callback) { |
|
161 | 161 | if ($this->exitCode === EXIT_SUCCESS) { |
162 | 162 | $container->call($callback); |
163 | 163 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function onFailure(Closure $callback): self |
171 | 171 | { |
172 | - return $this->then(function (ContainerInterface $container) use ($callback) { |
|
172 | + return $this->then(function(ContainerInterface $container) use ($callback) { |
|
173 | 173 | if ($this->exitCode !== EXIT_SUCCESS) { |
174 | 174 | $container->call($callback, array_filter([$this->exception])); |
175 | 175 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | protected function ensureOutputIsBeingCaptured() |
259 | 259 | { |
260 | 260 | if (is_null($this->output) || $this->output == $this->getDefaultOutput()) { |
261 | - $this->sendOutputTo(storage_path('logs/schedule-'.sha1($this->mutexName()).'.log')); |
|
261 | + $this->sendOutputTo(storage_path('logs/schedule-' . sha1($this->mutexName()) . '.log')); |
|
262 | 262 | } |
263 | 263 | } |
264 | 264 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function __construct(protected string $type, protected mixed $action, protected array $parameters = []) |
81 | 81 | { |
82 | - if (! in_array($type, $this->types, true)) { |
|
82 | + if (!in_array($type, $this->types, true)) { |
|
83 | 83 | throw TasksException::invalidTaskType($type); |
84 | 84 | } |
85 | 85 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function run() |
123 | 123 | { |
124 | 124 | $method = 'run' . ucfirst($this->type); |
125 | - if (! method_exists($this, $method)) { |
|
125 | + if (!method_exists($this, $method)) { |
|
126 | 126 | throw TasksException::invalidTaskType($this->type); |
127 | 127 | } |
128 | 128 | |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | $cron = service('cronExpression')->setTimezone($this->timezone); |
138 | 138 | |
139 | 139 | // Autoriser le réglage des heures pendant les tests |
140 | - if (! empty($testTime)) { |
|
140 | + if (!empty($testTime)) { |
|
141 | 141 | $cron->testTime($testTime); |
142 | 142 | } |
143 | 143 | |
144 | 144 | // Sommes-nous limités aux environnements? |
145 | - if (! $this->runsInEnvironment(environment())) { |
|
145 | + if (!$this->runsInEnvironment(environment())) { |
|
146 | 146 | return false; |
147 | 147 | } |
148 | 148 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | protected function runEvent(): bool |
246 | 246 | { |
247 | - return ! (false === service('event')->emit($this->getAction())); |
|
247 | + return !(false === service('event')->emit($this->getAction())); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |