@@ -46,7 +46,7 @@ |
||
46 | 46 | ->treatNullLike([]) |
47 | 47 | ->beforeNormalization()->castToArray()->end() |
48 | 48 | ->beforeNormalization() |
49 | - ->always(function (array $emails) { |
|
49 | + ->always(function(array $emails) { |
|
50 | 50 | foreach ($emails as $email) { |
51 | 51 | Assert::true((bool) filter_var($email, FILTER_VALIDATE_EMAIL), sprintf( |
52 | 52 | "You should provide valid email. '%s' not looks like valid email.", |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function configureOptions(OptionsResolver $resolver): void |
44 | 44 | { |
45 | 45 | $resolver->setDefaults([ |
46 | - 'choices' => function (Options $options): array { |
|
46 | + 'choices' => function(Options $options): array { |
|
47 | 47 | return $this->scheduleRepository->findAll(); |
48 | 48 | }, |
49 | 49 | 'choice_value' => 'code', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | ->scalarNode('state') |
37 | 37 | ->beforeNormalization() |
38 | 38 | ->ifString() |
39 | - ->then(function (string $value) { |
|
39 | + ->then(function(string $value) { |
|
40 | 40 | Assert::oneOf($value, Job::getStates(), sprintf( |
41 | 41 | 'Invalid state provided: %s. Expected one of: %s', |
42 | 42 | $value, |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | protected function configureOptions(OptionsResolver $resolver): void |
91 | 91 | { |
92 | 92 | $resolver |
93 | - ->setDefault('name', function (Options $options): string { |
|
93 | + ->setDefault('name', function(Options $options): string { |
|
94 | 94 | return $this->faker->words(3, true); |
95 | 95 | }) |
96 | - ->setDefault('code', function (Options $options): string { |
|
96 | + ->setDefault('code', function(Options $options): string { |
|
97 | 97 | return StringInflector::nameToCode($options['name']); |
98 | 98 | }) |
99 | 99 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ->setDefined('queue') |
108 | 108 | ->setAllowedTypes('queue', ['null', 'string']) |
109 | 109 | |
110 | - ->setDefault('priority', function (Options $options): int { |
|
110 | + ->setDefault('priority', function(Options $options): int { |
|
111 | 111 | return $this->faker->randomElement([ |
112 | 112 | JobInterface::PRIORITY_LOW, |
113 | 113 | JobInterface::PRIORITY_DEFAULT, |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ->setDefined('queue') |
166 | 166 | ->setAllowedTypes('queue', ['null', 'string']) |
167 | 167 | |
168 | - ->setDefault('priority', function (Options $options): int { |
|
168 | + ->setDefault('priority', function(Options $options): int { |
|
169 | 169 | return $this->faker->randomElement([ |
170 | 170 | JobInterface::PRIORITY_LOW, |
171 | 171 | JobInterface::PRIORITY_DEFAULT, |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // ->setAllowedTypes('original_job', ['null', 'object']) |
217 | 217 | |
218 | 218 | ->setDefined('retry_jobs') |
219 | - ->setNormalizer('retry_jobs', function ($options) { |
|
219 | + ->setNormalizer('retry_jobs', function($options) { |
|
220 | 220 | return $this->faker->numberBetween(0, 4); |
221 | 221 | }) |
222 | 222 | ->setAllowedTypes('retry_jobs', 'int') |
@@ -46,7 +46,7 @@ |
||
46 | 46 | ->setAllowedTypes('prototype', 'array') |
47 | 47 | ->setDefault('custom', []) |
48 | 48 | ->setAllowedTypes('custom', 'array') |
49 | - ->setNormalizer('custom', function (Options $options, array $custom) { |
|
49 | + ->setNormalizer('custom', function(Options $options, array $custom) { |
|
50 | 50 | if ($options['random'] <= 0) { |
51 | 51 | return $custom; |
52 | 52 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | $result = $connection->executeQuery($incomingDepsSql, ['id' => $job->getId()]); |
126 | 126 | if ($result->fetchColumn() !== false) { |
127 | - $this->entityManager->transactional(function () use ($job) { |
|
127 | + $this->entityManager->transactional(function() use ($job) { |
|
128 | 128 | $this->resolveDependencies($job); |
129 | 129 | $this->entityManager->remove($job); |
130 | 130 | }); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | private function findExpiredJobs(InputInterface $input): \Generator |
182 | 182 | { |
183 | - $succeededJobs = function (array $excludedIds) use ($input) { |
|
183 | + $succeededJobs = function(array $excludedIds) use ($input) { |
|
184 | 184 | return $this->jobRepository->findSucceededBefore( |
185 | 185 | new \DateTime(sprintf( |
186 | 186 | '-%s', |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | yield $job; |
194 | 194 | } |
195 | 195 | |
196 | - $finishedJobs = function (array $excludedIds) use ($input) { |
|
196 | + $finishedJobs = function(array $excludedIds) use ($input) { |
|
197 | 197 | return $this->jobRepository->findFinishedBefore( |
198 | 198 | new \DateTime(sprintf( |
199 | 199 | '-%s', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | yield $job; |
207 | 207 | } |
208 | 208 | |
209 | - $canceledJobs = function (array $excludedIds) use ($input) { |
|
209 | + $canceledJobs = function(array $excludedIds) use ($input) { |
|
210 | 210 | return $this->jobRepository->findCancelledBefore( |
211 | 211 | new \DateTime(sprintf( |
212 | 212 | '-%s', |
@@ -230,7 +230,7 @@ |
||
230 | 230 | |
231 | 231 | private function setupSignalHandlers(): void |
232 | 232 | { |
233 | - pcntl_signal(SIGTERM, function () { |
|
233 | + pcntl_signal(SIGTERM, function() { |
|
234 | 234 | if ($this->verbose) { |
235 | 235 | $this->output->writeln('Received SIGTERM signal.'); |
236 | 236 | } |