@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $workerName = $request->get('workerName'); |
129 | 129 | $methodName = $request->get('method'); |
130 | 130 | $total = null; |
131 | - $callback = function ($count, $totalCount) use (&$total) { |
|
131 | + $callback = function($count, $totalCount) use (&$total) { |
|
132 | 132 | if (null !== $totalCount && null === $total) { |
133 | 133 | $total = $totalCount; |
134 | 134 | echo json_encode(['total' => $total]); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | flush(); |
143 | 143 | }; |
144 | 144 | |
145 | - return function () use ($jobManager, $callback, $workerName, $methodName, $functionName, &$total) { |
|
145 | + return function() use ($jobManager, $callback, $workerName, $methodName, $functionName, &$total) { |
|
146 | 146 | switch ($functionName) { |
147 | 147 | case 'archiveAllJobs': |
148 | 148 | $total = $jobManager->countLiveJobs($workerName, $methodName); |
@@ -431,7 +431,7 @@ |
||
431 | 431 | { |
432 | 432 | $cursor = null; |
433 | 433 | while ($jobs = $this->redis->zScan($cacheKey, $cursor, '', 100)) { |
434 | - $jobs = $this->redis->mget(array_map(function ($item) { |
|
434 | + $jobs = $this->redis->mget(array_map(function($item) { |
|
435 | 435 | return $this->getJobCacheKey($item); |
436 | 436 | }, array_keys($jobs))); |
437 | 437 | $this->extractStatusResults($jobs, $results); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | ->scalarNode('dsn')->defaultNull()->end() |
16 | 16 | ->append($this->addPredisArgs()) |
17 | 17 | ->end() |
18 | - ->validate()->ifTrue(function ($node) { |
|
18 | + ->validate()->ifTrue(function($node) { |
|
19 | 19 | if (isset($node['dsn']) && (isset($node['connection_parameters']['host']) || isset($node['connection_parameters']['port']))) { |
20 | 20 | return true; |
21 | 21 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ->append($this->addPredis()) |
59 | 59 | ->append($this->addPhpRedisArgs()) |
60 | 60 | ->end() |
61 | - ->validate()->ifTrue(function ($node) { |
|
61 | + ->validate()->ifTrue(function($node) { |
|
62 | 62 | if ($this->checkPredis($node)) { |
63 | 63 | return true; |
64 | 64 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | ->floatNode('read_timeout')->defaultValue(0)->end() |
87 | 87 | ->scalarNode('auth')->end() |
88 | 88 | ->end() |
89 | - ->validate()->ifTrue(function ($node) { |
|
89 | + ->validate()->ifTrue(function($node) { |
|
90 | 90 | if (!empty($node) && !isset($node['host'])) { |
91 | 91 | return true; |
92 | 92 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ->booleanNode('iterable_multibulk')->defaultFalse()->end() |
120 | 120 | ->booleanNode('throw_errors')->defaultTrue()->end() |
121 | 121 | ->end() |
122 | - ->validate()->ifTrue(function ($node) { |
|
122 | + ->validate()->ifTrue(function($node) { |
|
123 | 123 | if (isset($node['host']) && !isset($node['port'])) { |
124 | 124 | return true; |
125 | 125 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | ->scalarNode('alias') |
146 | 146 | ->defaultNull()->end() |
147 | 147 | ->end() |
148 | - ->validate()->ifTrue(function ($node) { |
|
148 | + ->validate()->ifTrue(function($node) { |
|
149 | 149 | if (isset($node['type']) && !isset($node['alias'])) { |
150 | 150 | return true; |
151 | 151 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $rootNode |
33 | 33 | ->prototype('variable')->end() |
34 | 34 | ->validate() |
35 | - ->ifTrue(function ($node) { |
|
35 | + ->ifTrue(function($node) { |
|
36 | 36 | if (!is_array($node)) { |
37 | 37 | return true; |
38 | 38 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ->append($this->addRabbitMqArgs()) |
110 | 110 | ->append($this->addRabbitMqExchange()) |
111 | 111 | ->end() |
112 | - ->validate()->always(function ($node) { |
|
112 | + ->validate()->always(function($node) { |
|
113 | 113 | if (empty($node['ssl_options'])) { |
114 | 114 | unset($node['ssl_options']); |
115 | 115 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | return $node; |
121 | 121 | })->end() |
122 | - ->validate()->ifTrue(function ($node) { |
|
122 | + ->validate()->ifTrue(function($node) { |
|
123 | 123 | if (isset($node['ssl_options']) && !$node['ssl']) { |
124 | 124 | return true; |
125 | 125 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $firstJob = key($status); |
27 | 27 | if ($firstJob) { |
28 | 28 | $jobKeys = array_keys($status); |
29 | - $maxLength = max(array_map(function ($item) { |
|
29 | + $maxLength = max(array_map(function($item) { |
|
30 | 30 | return strlen($item ?: ''); |
31 | 31 | }, $jobKeys)); |
32 | 32 | $formatLen = $this->determineFormatLength($maxLength); |
@@ -63,11 +63,11 @@ |
||
63 | 63 | $this->getName(), // command |
64 | 64 | 'my-worker-name', // worker_name |
65 | 65 | 'myMethod', // method |
66 | - json_encode([ // args |
|
66 | + json_encode([// args |
|
67 | 67 | 'first parameter', // argv[0] (string) |
68 | 68 | null, // argv[1] (null) |
69 | 69 | 3, // argv[2] (int) |
70 | - [ // argv[3] (array) |
|
70 | + [// argv[3] (array) |
|
71 | 71 | 'fourth', |
72 | 72 | 'param', |
73 | 73 | 'is', |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | ]; |
160 | 160 | |
161 | 161 | try { |
162 | - $this->predis->transaction($options, function (MultiExec $tx) use ($key, &$element) { |
|
162 | + $this->predis->transaction($options, function(MultiExec $tx) use ($key, &$element) { |
|
163 | 163 | $zRange = $tx->zrange($key, 0, 0); |
164 | 164 | $element = isset($zRange[0]) ? $zRange[0] : null; |
165 | 165 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | ]; |
186 | 186 | |
187 | 187 | try { |
188 | - $this->predis->transaction($options, function (MultiExec $tx) use ($key, $max, &$element) { |
|
188 | + $this->predis->transaction($options, function(MultiExec $tx) use ($key, $max, &$element) { |
|
189 | 189 | $zRangeByScore = $tx->zrangebyscore($key, 0, $max, ['LIMIT' => [0, 1]]); |
190 | 190 | $element = isset($zRangeByScore[0]) ? $zRangeByScore[0] : null; |
191 | 191 |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $hasEnDecimalPoint = $decimalPoint === '.' ? $hasDecimalPoint : strpos(strval($time), '.'); |
60 | 60 | if (!$hasEnDecimalPoint) { |
61 | 61 | if ($hasDecimalPoint) { |
62 | - $dateTime = \DateTime::createFromFormat('U' . $decimalPoint . 'u', strval($timeU), |
|
62 | + $dateTime = \DateTime::createFromFormat('U'.$decimalPoint.'u', strval($timeU), |
|
63 | 63 | new \DateTimeZone(date_default_timezone_get())); |
64 | 64 | } else { |
65 | 65 | $dateTime = \DateTime::createFromFormat('U', strval($timeU), |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $format = $this->getDateFormat($type); |
85 | - usort($timingsDates, function ($date1str, $date2str) use ($format) { |
|
85 | + usort($timingsDates, function($date1str, $date2str) use ($format) { |
|
86 | 86 | $date1 = \DateTime::createFromFormat($format, $date1str, new \DateTimeZone(date_default_timezone_get())); |
87 | 87 | $date2 = \DateTime::createFromFormat($format, $date2str, new \DateTimeZone(date_default_timezone_get())); |
88 | 88 | if (!$date2) { |
@@ -282,21 +282,21 @@ discard block |
||
282 | 282 | case 'YEAR': |
283 | 283 | return $result['year']; |
284 | 284 | case 'MONTH': |
285 | - return "{$result['year']}-" . str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
285 | + return "{$result['year']}-".str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
286 | 286 | case 'DAY': |
287 | - $str = "{$result['year']}-" . str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
288 | - $str .= '-' . str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
287 | + $str = "{$result['year']}-".str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
288 | + $str .= '-'.str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
289 | 289 | return $str; |
290 | 290 | case 'HOUR': |
291 | - $str = "{$result['year']}-" . str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
292 | - $str .= '-' . str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
293 | - $str .= ' ' . str_pad($result['hour'], 2, "0", STR_PAD_LEFT); |
|
291 | + $str = "{$result['year']}-".str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
292 | + $str .= '-'.str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
293 | + $str .= ' '.str_pad($result['hour'], 2, "0", STR_PAD_LEFT); |
|
294 | 294 | return $str; |
295 | 295 | case 'MINUTE': |
296 | - $str = "{$result['year']}-" . str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
297 | - $str .= '-' . str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
298 | - $str .= ' ' . str_pad($result['hour'], 2, "0", STR_PAD_LEFT); |
|
299 | - $str .= ':' . str_pad($result['minute'], 2, "0", STR_PAD_LEFT); |
|
296 | + $str = "{$result['year']}-".str_pad($result['month'], 2, "0", STR_PAD_LEFT); |
|
297 | + $str .= '-'.str_pad($result['day'], 2, "0", STR_PAD_LEFT); |
|
298 | + $str .= ' '.str_pad($result['hour'], 2, "0", STR_PAD_LEFT); |
|
299 | + $str .= ':'.str_pad($result['minute'], 2, "0", STR_PAD_LEFT); |
|
300 | 300 | return $str; |
301 | 301 | default: |
302 | 302 | throw new \InvalidArgumentException("Invalid date format type '$type''"); |