@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * Internal wrapper method, mainly for testing. |
| 189 | 189 | * |
| 190 | 190 | * @param resource $stream |
| 191 | - * @param $len |
|
| 191 | + * @param integer|null $len |
|
| 192 | 192 | * |
| 193 | 193 | * @return string |
| 194 | 194 | */ |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Internal wrapper method, mainly for testing. |
| 216 | 216 | * |
| 217 | - * @param $stream |
|
| 217 | + * @param resource $stream |
|
| 218 | 218 | * |
| 219 | 219 | * @return array |
| 220 | 220 | */ |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | return array_reduce( |
| 26 | 26 | $args, |
| 27 | - function ($msg, $arg) { |
|
| 27 | + function($msg, $arg) { |
|
| 28 | 28 | return $msg.'$'.strlen($arg)."\r\n".$arg."\r\n"; |
| 29 | 29 | }, |
| 30 | 30 | '*'.count($args)."\r\n" |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | return trim($stream->readBytes($result + 2)); |
| 67 | 67 | |
| 68 | 68 | case '*': // ARRAYS |
| 69 | - $cnt = (int)$result; |
|
| 69 | + $cnt = (int) $result; |
|
| 70 | 70 | $out = []; |
| 71 | 71 | |
| 72 | 72 | for ($i = 0; $i < $cnt; $i++) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function connect() |
| 61 | 61 | { |
| 62 | - $key = array_reduce($this->nodeUrls, function ($current, $prev) { |
|
| 62 | + $key = array_reduce($this->nodeUrls, function($current, $prev) { |
|
| 63 | 63 | return md5($current.$prev); |
| 64 | 64 | }, ''); |
| 65 | 65 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function setCacheTtl($ttl) |
| 102 | 102 | { |
| 103 | - $this->ttl = (int)$ttl; |
|
| 103 | + $this->ttl = (int) $ttl; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | private function updateNodes($key, StreamInterface $stream) |
| 114 | 114 | { |
| 115 | - $this->nodeUrls = array_map(function (NodeInfo $element) { |
|
| 115 | + $this->nodeUrls = array_map(function(NodeInfo $element) { |
|
| 116 | 116 | return $element->getServer(); |
| 117 | 117 | }, (new Node($stream, $this->log))->hello()); |
| 118 | 118 | |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string[] $queues |
| 20 | - * @param $count |
|
| 21 | - * @param $timeout |
|
| 20 | + * @param integer $count |
|
| 21 | + * @param integer $timeout |
|
| 22 | 22 | */ |
| 23 | 23 | public function __construct(array $queues, $count, $timeout) |
| 24 | 24 | { |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * |
| 115 | 115 | * The list is ordered descending by the frequency of Jobs. |
| 116 | 116 | * |
| 117 | - * @return float[] |
|
| 117 | + * @return string |
|
| 118 | 118 | */ |
| 119 | 119 | public function nodes($queue) |
| 120 | 120 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Phloppy\Statistic; |
| 4 | 4 | |
| 5 | -use Phloppy\Exception; |
|
| 6 | 5 | use Phloppy\Job; |
| 7 | 6 | use Psr\Log\LoggerInterface; |
| 8 | 7 | use Psr\Log\NullLogger; |
@@ -36,6 +36,7 @@ |
||
| 36 | 36 | * If the node is not known, no messages have been retrieved from it, so 0. will be returned. |
| 37 | 37 | * |
| 38 | 38 | * @param $nodeId |
| 39 | + * @param string $queue |
|
| 39 | 40 | * |
| 40 | 41 | * @return float |
| 41 | 42 | */ |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | */ |
| 108 | 108 | public function setDelay($delay) |
| 109 | 109 | { |
| 110 | - $this->delay = (int)$delay; |
|
| 110 | + $this->delay = (int) $delay; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | protected function mapJobs(array $list) |
| 96 | 96 | { |
| 97 | 97 | return array_map( |
| 98 | - function ($element) { |
|
| 98 | + function($element) { |
|
| 99 | 99 | return Job::create([ |
| 100 | 100 | 'queue' => $element[0], |
| 101 | 101 | 'id' => $element[1], |