@@ -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) |
@@ -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 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * @param array $payload |
| 41 | 41 | * |
| 42 | - * @return Exception|Throwable |
|
| 42 | + * @return Error |
|
| 43 | 43 | */ |
| 44 | 44 | public static function error($payload) |
| 45 | 45 | { |
@@ -60,10 +60,9 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * @param mixed $uniqid |
| 63 | - * @param Exception|Throwable $payload |
|
| 64 | 63 | * @param mixed $et |
| 65 | 64 | * |
| 66 | - * @return Rpc |
|
| 65 | + * @return RpcError |
|
| 67 | 66 | */ |
| 68 | 67 | public static function rpcError($uniqid, $et) |
| 69 | 68 | { |
@@ -138,7 +137,7 @@ discard block |
||
| 138 | 137 | /** |
| 139 | 138 | * @param array $line |
| 140 | 139 | * |
| 141 | - * @return Rpc |
|
| 140 | + * @return RpcError |
|
| 142 | 141 | */ |
| 143 | 142 | protected static function rpcErrorFromLine(array $line) |
| 144 | 143 | { |
@@ -156,7 +155,7 @@ discard block |
||
| 156 | 155 | |
| 157 | 156 | /** |
| 158 | 157 | * @param array $line |
| 159 | - * @return RpcSuccess |
|
| 158 | + * @return RpcNotify |
|
| 160 | 159 | */ |
| 161 | 160 | protected static function rpcNotifyFromLine(array $line) |
| 162 | 161 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * @return mixed |
|
| 45 | + * @return string |
|
| 46 | 46 | */ |
| 47 | 47 | public function getUniqid() |
| 48 | 48 | { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | - * @param mixed $value |
|
| 83 | + * @param CommunicationWithProcessUnexpectedEndException $value |
|
| 84 | 84 | */ |
| 85 | 85 | public function reject($value) |
| 86 | 86 | { |
@@ -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)); |