| @@ -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; | 
| @@ -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 $time = null): ReceivedCommand | 
| @@ -43,7 +43,7 @@ discard block | ||
| 43 | 43 |          if (empty($id)) { | 
| 44 | 44 | throw new TimeoutException; | 
| 45 | 45 | } | 
| 46 | -        $serialized = $this->evalScript('receive_message', [$this->namespace, $queueName, $id]); | |
| 46 | +        $serialized = $this->evalScript('receive_message', [ $this->namespace, $queueName, $id ]); | |
| 47 | 47 |          if (empty($serialized)) { | 
| 48 | 48 |              throw new DriverException(sprintf('Error retrieving command %s.', $id)); | 
| 49 | 49 | } | 
| @@ -101,19 +101,19 @@ discard block | ||
| 101 | 101 | |
| 102 | 102 | public function deleteQueue(string $queueName) | 
| 103 | 103 |      { | 
| 104 | -        $this->evalScript('empty_queue', [$this->namespace, $queueName]); | |
| 104 | +        $this->evalScript('empty_queue', [ $this->namespace, $queueName ]); | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | public function purgeCommand(string $queueName, string $id) | 
| 108 | 108 |      { | 
| 109 | -        $this->evalScript('purge_message', [$this->namespace, $queueName, $id]); | |
| 109 | +        $this->evalScript('purge_message', [ $this->namespace, $queueName, $id ]); | |
| 110 | 110 | } | 
| 111 | 111 | |
| 112 | 112 | public function scheduleCommand(string $queueName, string $id, string $serialized, \DateTime $dateTime) | 
| 113 | 113 |      { | 
| 114 | 114 | $this->evalScript( | 
| 115 | 115 | 'schedule_message', | 
| 116 | - [$this->namespace, $queueName, $id, $serialized, $dateTime->getTimestamp()] | |
| 116 | + [ $this->namespace, $queueName, $id, $serialized, $dateTime->getTimestamp() ] | |
| 117 | 117 | ); | 
| 118 | 118 | } | 
| 119 | 119 | |
| @@ -181,12 +181,12 @@ discard block | ||
| 181 | 181 | |
| 182 | 182 | public function purgeNamespace() | 
| 183 | 183 |      { | 
| 184 | -        $this->evalScript('purge_namespace', [$this->namespace]); | |
| 184 | +        $this->evalScript('purge_namespace', [ $this->namespace ]); | |
| 185 | 185 | } | 
| 186 | 186 | |
| 187 | 187 | private function evalScript(string $script, array $args) | 
| 188 | 188 |      { | 
| 189 | - $path = self::LUA_PATH . '/' . $script . '.lua'; | |
| 189 | + $path = self::LUA_PATH.'/'.$script.'.lua'; | |
| 190 | 190 | $lua = file_get_contents($path); | 
| 191 | 191 | return $this->adapter->evalLua($lua, $args); | 
| 192 | 192 | } | 
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 |          if ($expiry === null) { | 
| 52 | 52 | $start = null; | 
| 53 | 53 |          } else { | 
| 54 | -            $start = new \DateTimeImmutable('@' . ($now->getTimestamp() - $expiry->s)); | |
| 54 | +            $start = new \DateTimeImmutable('@'.($now->getTimestamp() - $expiry->s)); | |
| 55 | 55 | } | 
| 56 | 56 | $receivedCommands = $this->implementation->getSchedulerDriver() | 
| 57 | 57 | ->receiveDueCommands($now, $throttle, $start); |