@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * @var MethodNameInflector[] |
12 | 12 | */ |
13 | - private $inflectors = []; |
|
13 | + private $inflectors = [ ]; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param MethodNameInflector[] $inflectors |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | public function __construct(array $inflectors) |
19 | 19 | { |
20 | 20 | array_walk($inflectors, function (MethodNameInflector $inflector) { |
21 | - $this->inflectors[] = $inflector; |
|
21 | + $this->inflectors[ ] = $inflector; |
|
22 | 22 | }); |
23 | 23 | } |
24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | foreach ($this->inflectors as $inflector) { |
28 | 28 | $methodName = $inflector->inflect($command, $handler); |
29 | - if (is_callable([$handler, $methodName])) { |
|
29 | + if (is_callable([ $handler, $methodName ])) { |
|
30 | 30 | return $methodName; |
31 | 31 | } |
32 | 32 | } |
@@ -19,8 +19,8 @@ |
||
19 | 19 | { |
20 | 20 | if (is_object($command)) { |
21 | 21 | $class = get_class($command); |
22 | - if (isset($this->map[$class])) { |
|
23 | - return $this->map[$class]; |
|
22 | + if (isset($this->map[ $class ])) { |
|
23 | + return $this->map[ $class ]; |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | throw new QueueResolverException; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function unserialize(string $serialized) |
17 | 17 | { |
18 | - set_error_handler([$this, 'handleError']); |
|
18 | + set_error_handler([ $this, 'handleError' ]); |
|
19 | 19 | $unserialized = unserialize($serialized); |
20 | 20 | restore_error_handler(); |
21 | 21 | return $unserialized; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public function getIterator() |
17 | 17 | { |
18 | 18 | if (!$this->getConnection() instanceof \Traversable) { |
19 | - return new \ArrayIterator([$this]); |
|
19 | + return new \ArrayIterator([ $this ]); |
|
20 | 20 | } |
21 | 21 | return parent::getIterator(); |
22 | 22 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | final class RedisDriver implements QueueDriverInterface, SchedulerDriverInterface |
15 | 15 | { |
16 | 16 | |
17 | - const LUA_PATH = __DIR__ . '/../../lua'; |
|
17 | + const LUA_PATH = __DIR__.'/../../lua'; |
|
18 | 18 | |
19 | 19 | private $adapter; |
20 | 20 | private $namespace; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function queueCommand(string $queueName, string $commandId, string $serialized) |
32 | 32 | { |
33 | - $this->evalScript('queue_message', [$this->namespace, $queueName, $commandId, $serialized]); |
|
33 | + $this->evalScript('queue_message', [ $this->namespace, $queueName, $commandId, $serialized ]); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function awaitCommand(string $queueName, int $timeout = null): ReceivedCommand |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $id = null; |
48 | 48 | } |
49 | 49 | if (!empty($id)) { |
50 | - $serialized = $this->evalScript('receive_message', [$this->namespace, $queueName, $id]); |
|
50 | + $serialized = $this->evalScript('receive_message', [ $this->namespace, $queueName, $id ]); |
|
51 | 51 | if (!empty($serialized)) { |
52 | 52 | return new ReceivedCommand($queueName, $id, $serialized); |
53 | 53 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | public function completeCommand(string $queueName, string $id) |
65 | 65 | { |
66 | - $this->evalScript('acknowledge_message', [$this->namespace, $queueName, $id]); |
|
66 | + $this->evalScript('acknowledge_message', [ $this->namespace, $queueName, $id ]); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function putQueue(string $queueName) |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | |
123 | 123 | public function deleteQueue(string $queueName) |
124 | 124 | { |
125 | - $this->evalScript('empty_queue', [$this->namespace, $queueName]); |
|
125 | + $this->evalScript('empty_queue', [ $this->namespace, $queueName ]); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | public function purgeCommand(string $queueName, string $id) |
129 | 129 | { |
130 | - $this->evalScript('purge_message', [$this->namespace, $queueName, $id]); |
|
130 | + $this->evalScript('purge_message', [ $this->namespace, $queueName, $id ]); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | public function scheduleCommand(string $queueName, string $id, string $serialized, \DateTime $dateTime) |
134 | 134 | { |
135 | 135 | $this->evalScript( |
136 | 136 | 'schedule_message', |
137 | - [$this->namespace, $queueName, $id, $serialized, $dateTime->getTimestamp()] |
|
137 | + [ $this->namespace, $queueName, $id, $serialized, $dateTime->getTimestamp() ] |
|
138 | 138 | ); |
139 | 139 | } |
140 | 140 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | public function purgeNamespace() |
204 | 204 | { |
205 | - $this->evalScript('purge_namespace', [$this->namespace]); |
|
205 | + $this->evalScript('purge_namespace', [ $this->namespace ]); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | private function evalScript(string $script, array $args) |
@@ -212,6 +212,6 @@ discard block |
||
212 | 212 | |
213 | 213 | private function getScriptPath(string $script): string |
214 | 214 | { |
215 | - return self::LUA_PATH . '/' . $script . '.lua'; |
|
215 | + return self::LUA_PATH.'/'.$script.'.lua'; |
|
216 | 216 | } |
217 | 217 | } |