@@ -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)); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use React\EventLoop\LoopInterface; |
| 7 | 7 | use React\Promise\FulfilledPromise; |
| 8 | 8 | use React\Stream\ReadableResourceStream; |
| 9 | -use React\Stream\Stream; |
|
| 10 | 9 | use React\Stream\Util; |
| 11 | 10 | use React\Stream\WritableResourceStream; |
| 12 | 11 | use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory as MessengesFactory; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** |
| 135 | 135 | * @param $target |
| 136 | 136 | * @param $payload |
| 137 | - * @return React\Promise\PromiseInterface |
|
| 137 | + * @return PromiseInterface |
|
| 138 | 138 | */ |
| 139 | 139 | public function callRpc($target, $payload) |
| 140 | 140 | { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * @param ActionableMessageInterface $line |
| 196 | - * @return LineInterface |
|
| 196 | + * @return string |
|
| 197 | 197 | */ |
| 198 | 198 | public function createLine(ActionableMessageInterface $line) |
| 199 | 199 | { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | - * @return Stream |
|
| 214 | + * @return ReadableStreamInterface |
|
| 215 | 215 | */ |
| 216 | 216 | public function getStdin() |
| 217 | 217 | { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
| 222 | - * @return Stream |
|
| 222 | + * @return WritableStreamInterface |
|
| 223 | 223 | */ |
| 224 | 224 | public function getStdout() |
| 225 | 225 | { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | - * @return Stream |
|
| 230 | + * @return WritableStreamInterface |
|
| 231 | 231 | */ |
| 232 | 232 | public function getStderr() |
| 233 | 233 | { |