@@ -43,7 +43,7 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * @param $uniqid |
|
| 46 | + * @param string $uniqid |
|
| 47 | 47 | * @return static |
| 48 | 48 | */ |
| 49 | 49 | public function setUniqid($uniqid) |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * @return mixed |
|
| 45 | + * @return string |
|
| 46 | 46 | */ |
| 47 | 47 | public function getUniqid() |
| 48 | 48 | { |
@@ -57,11 +57,10 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * @param string $target |
|
| 61 | 60 | * @param array $payload |
| 62 | 61 | * @param mixed $uniqid |
| 63 | 62 | * |
| 64 | - * @return Rpc |
|
| 63 | + * @return RpcError |
|
| 65 | 64 | */ |
| 66 | 65 | public static function rpcError($uniqid, array $payload = []) |
| 67 | 66 | { |
@@ -83,7 +82,7 @@ discard block |
||
| 83 | 82 | * @param string $uniqid |
| 84 | 83 | * @param array $payload |
| 85 | 84 | * |
| 86 | - * @return RpcSuccess |
|
| 85 | + * @return RpcNotify |
|
| 87 | 86 | */ |
| 88 | 87 | public static function rpcNotify($uniqid, array $payload = []) |
| 89 | 88 | { |
@@ -136,7 +135,7 @@ discard block |
||
| 136 | 135 | /** |
| 137 | 136 | * @param array $line |
| 138 | 137 | * |
| 139 | - * @return Rpc |
|
| 138 | + * @return RpcError |
|
| 140 | 139 | */ |
| 141 | 140 | protected static function rpcErrorFromLine(array $line) |
| 142 | 141 | { |
@@ -154,7 +153,7 @@ discard block |
||
| 154 | 153 | |
| 155 | 154 | /** |
| 156 | 155 | * @param array $line |
| 157 | - * @return RpcSuccess |
|
| 156 | + * @return RpcNotify |
|
| 158 | 157 | */ |
| 159 | 158 | protected static function rpcNotifyFromLine(array $line) |
| 160 | 159 | { |
@@ -38,6 +38,9 @@ discard block |
||
| 38 | 38 | ]) . LineInterface::EOL; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $line |
|
| 43 | + */ |
|
| 41 | 44 | public static function fromLine($line, array $lineOptions) |
| 42 | 45 | { |
| 43 | 46 | if (static::validate(base64_decode($line['signature'], true), $line['line'], $lineOptions['key'])) { |
@@ -52,6 +55,9 @@ discard block |
||
| 52 | 55 | return hash_hmac('sha256', $line, $key, true); |
| 53 | 56 | } |
| 54 | 57 | |
| 58 | + /** |
|
| 59 | + * @param string $signature |
|
| 60 | + */ |
|
| 55 | 61 | protected static function validate($signature, $line, $key) |
| 56 | 62 | { |
| 57 | 63 | return hash_equals($signature, static::sign($line, $key)); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | /** |
| 128 | 128 | * @param $target |
| 129 | 129 | * @param $payload |
| 130 | - * @return React\Promise\PromiseInterface |
|
| 130 | + * @return PromiseInterface |
|
| 131 | 131 | */ |
| 132 | 132 | public function callRpc($target, $payload) |
| 133 | 133 | { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | /** |
| 188 | 188 | * @param ActionableMessageInterface $line |
| 189 | - * @return LineInterface |
|
| 189 | + * @return string |
|
| 190 | 190 | */ |
| 191 | 191 | public function createLine(ActionableMessageInterface $line) |
| 192 | 192 | { |