@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | $ignoreErrors = []; |
4 | 4 | $ignoreErrors[] = [ |
@@ -2,58 +2,58 @@ |
||
2 | 2 | |
3 | 3 | $ignoreErrors = []; |
4 | 4 | $ignoreErrors[] = [ |
5 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<cronExpression\\>, string given\\.$#', |
|
6 | - 'identifier' => 'argument.type', |
|
7 | - 'count' => 1, |
|
8 | - 'path' => __DIR__ . '/src/Commands/Lister.php', |
|
5 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<cronExpression\\>, string given\\.$#', |
|
6 | + 'identifier' => 'argument.type', |
|
7 | + 'count' => 1, |
|
8 | + 'path' => __DIR__ . '/src/Commands/Lister.php', |
|
9 | 9 | ]; |
10 | 10 | $ignoreErrors[] = [ |
11 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
12 | - 'identifier' => 'argument.type', |
|
13 | - 'count' => 1, |
|
14 | - 'path' => __DIR__ . '/src/Commands/Lister.php', |
|
11 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
12 | + 'identifier' => 'argument.type', |
|
13 | + 'count' => 1, |
|
14 | + 'path' => __DIR__ . '/src/Commands/Lister.php', |
|
15 | 15 | ]; |
16 | 16 | $ignoreErrors[] = [ |
17 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
18 | - 'identifier' => 'argument.type', |
|
19 | - 'count' => 1, |
|
20 | - 'path' => __DIR__ . '/src/Commands/Run.php', |
|
17 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
18 | + 'identifier' => 'argument.type', |
|
19 | + 'count' => 1, |
|
20 | + 'path' => __DIR__ . '/src/Commands/Run.php', |
|
21 | 21 | ]; |
22 | 22 | $ignoreErrors[] = [ |
23 | - 'message' => '#^Cannot call method startOfMinute\\(\\) on BlitzPHP\\\\Utilities\\\\Date\\|string\\.$#', |
|
24 | - 'identifier' => 'method.nonObject', |
|
25 | - 'count' => 2, |
|
26 | - 'path' => __DIR__ . '/src/Commands/Work.php', |
|
23 | + 'message' => '#^Cannot call method startOfMinute\\(\\) on BlitzPHP\\\\Utilities\\\\Date\\|string\\.$#', |
|
24 | + 'identifier' => 'method.nonObject', |
|
25 | + 'count' => 2, |
|
26 | + 'path' => __DIR__ . '/src/Commands/Work.php', |
|
27 | 27 | ]; |
28 | 28 | $ignoreErrors[] = [ |
29 | - 'message' => '#^While loop condition is always true\\.$#', |
|
30 | - 'identifier' => 'while.alwaysTrue', |
|
31 | - 'count' => 1, |
|
32 | - 'path' => __DIR__ . '/src/Commands/Work.php', |
|
29 | + 'message' => '#^While loop condition is always true\\.$#', |
|
30 | + 'identifier' => 'while.alwaysTrue', |
|
31 | + 'count' => 1, |
|
32 | + 'path' => __DIR__ . '/src/Commands/Work.php', |
|
33 | 33 | ]; |
34 | 34 | $ignoreErrors[] = [ |
35 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<container\\>, string given\\.$#', |
|
36 | - 'identifier' => 'argument.type', |
|
37 | - 'count' => 1, |
|
38 | - 'path' => __DIR__ . '/src/Task.php', |
|
35 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<container\\>, string given\\.$#', |
|
36 | + 'identifier' => 'argument.type', |
|
37 | + 'count' => 1, |
|
38 | + 'path' => __DIR__ . '/src/Task.php', |
|
39 | 39 | ]; |
40 | 40 | $ignoreErrors[] = [ |
41 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<cronExpression\\>, string given\\.$#', |
|
42 | - 'identifier' => 'argument.type', |
|
43 | - 'count' => 1, |
|
44 | - 'path' => __DIR__ . '/src/Task.php', |
|
41 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<cronExpression\\>, string given\\.$#', |
|
42 | + 'identifier' => 'argument.type', |
|
43 | + 'count' => 1, |
|
44 | + 'path' => __DIR__ . '/src/Task.php', |
|
45 | 45 | ]; |
46 | 46 | $ignoreErrors[] = [ |
47 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<httpclient\\>, string given\\.$#', |
|
48 | - 'identifier' => 'argument.type', |
|
49 | - 'count' => 1, |
|
50 | - 'path' => __DIR__ . '/src/Task.php', |
|
47 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<httpclient\\>, string given\\.$#', |
|
48 | + 'identifier' => 'argument.type', |
|
49 | + 'count' => 1, |
|
50 | + 'path' => __DIR__ . '/src/Task.php', |
|
51 | 51 | ]; |
52 | 52 | $ignoreErrors[] = [ |
53 | - 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
54 | - 'identifier' => 'argument.type', |
|
55 | - 'count' => 1, |
|
56 | - 'path' => __DIR__ . '/src/TaskRunner.php', |
|
53 | + 'message' => '#^Parameter \\#1 \\$name of function service expects class\\-string\\<scheduler\\>, string given\\.$#', |
|
54 | + 'identifier' => 'argument.type', |
|
55 | + 'count' => 1, |
|
56 | + 'path' => __DIR__ . '/src/TaskRunner.php', |
|
57 | 57 | ]; |
58 | 58 | |
59 | 59 | return ['parameters' => ['ignoreErrors' => $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'); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $min = $hour = 0; |
67 | 67 | |
68 | - if (! empty($time)) { |
|
68 | + if (!empty($time)) { |
|
69 | 69 | [$min, $hour] = $this->parseTime($time); |
70 | 70 | } |
71 | 71 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function hours($hours = []): self |
131 | 131 | { |
132 | - if (! is_array($hours)) { |
|
132 | + if (!is_array($hours)) { |
|
133 | 133 | $hours = [$hours]; |
134 | 134 | } |
135 | 135 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function minutes($minutes = []): self |
193 | 193 | { |
194 | - if (! is_array($minutes)) { |
|
194 | + if (!is_array($minutes)) { |
|
195 | 195 | $minutes = [$minutes]; |
196 | 196 | } |
197 | 197 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function days($days): self |
209 | 209 | { |
210 | - if (! is_array($days)) { |
|
210 | + if (!is_array($days)) { |
|
211 | 211 | $days = [$days]; |
212 | 212 | } |
213 | 213 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | { |
280 | 280 | $min = $hour = 0; |
281 | 281 | |
282 | - if (! empty($time)) { |
|
282 | + if (!empty($time)) { |
|
283 | 283 | [$min, $hour] = $this->parseTime($time); |
284 | 284 | } |
285 | 285 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function daysOfMonth($days): self |
299 | 299 | { |
300 | - if (! is_array($days)) { |
|
300 | + if (!is_array($days)) { |
|
301 | 301 | $days = [$days]; |
302 | 302 | } |
303 | 303 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | { |
352 | 352 | $min = $hour = 0; |
353 | 353 | |
354 | - if (! empty($time)) { |
|
354 | + if (!empty($time)) { |
|
355 | 355 | [$min, $hour] = $this->parseTime($time); |
356 | 356 | } |
357 | 357 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | { |
372 | 372 | $min = $hour = 0; |
373 | 373 | |
374 | - if (! empty($time)) { |
|
374 | + if (!empty($time)) { |
|
375 | 375 | [$min, $hour] = $this->parseTime($time); |
376 | 376 | } |
377 | 377 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | { |
391 | 391 | $min = $hour = 0; |
392 | 392 | |
393 | - if (! empty($time)) { |
|
393 | + if (!empty($time)) { |
|
394 | 394 | [$min, $hour] = $this->parseTime($time); |
395 | 395 | } |
396 | 396 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | { |
409 | 409 | $min = $hour = 0; |
410 | 410 | |
411 | - if (! empty($time)) { |
|
411 | + if (!empty($time)) { |
|
412 | 412 | [$min, $hour] = $this->parseTime($time); |
413 | 413 | } |
414 | 414 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | { |
427 | 427 | $min = $hour = '*'; |
428 | 428 | |
429 | - if (! empty($time)) { |
|
429 | + if (!empty($time)) { |
|
430 | 430 | [$min, $hour] = $this->parseTime($time); |
431 | 431 | } |
432 | 432 |
@@ -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 |
@@ -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 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | $addresses = Arr::wrap($addresses); |
91 | 91 | |
92 | - return $this->then(function (MailerInterface $mailer) use ($addresses, $onlyIfOutputExists) { |
|
92 | + return $this->then(function(MailerInterface $mailer) use ($addresses, $onlyIfOutputExists) { |
|
93 | 93 | $this->emailOutput($mailer, $addresses, $onlyIfOutputExists); |
94 | 94 | }); |
95 | 95 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $addresses = Arr::wrap($addresses); |
119 | 119 | |
120 | - return $this->onFailure(function (MailerInterface $mailer) use ($addresses) { |
|
120 | + return $this->onFailure(function(MailerInterface $mailer) use ($addresses) { |
|
121 | 121 | $this->emailOutput($mailer, $addresses, false); |
122 | 122 | }); |
123 | 123 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function onSuccess(Closure $callback): self |
157 | 157 | { |
158 | - return $this->then(function (ContainerInterface $container) use ($callback) { |
|
158 | + return $this->then(function(ContainerInterface $container) use ($callback) { |
|
159 | 159 | if ($this->exitCode === EXIT_SUCCESS) { |
160 | 160 | $container->call($callback); |
161 | 161 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function onFailure(Closure $callback): self |
169 | 169 | { |
170 | - return $this->then(function (ContainerInterface $container) use ($callback) { |
|
170 | + return $this->then(function(ContainerInterface $container) use ($callback) { |
|
171 | 171 | if ($this->exitCode !== EXIT_SUCCESS) { |
172 | 172 | $container->call($callback, array_filter([$this->exception])); |
173 | 173 | } |