[Server] Refactor protocol pipeline to separate request and notification handling (#106)
This commit is contained in:
parent
9ff6516e5b
commit
54a5d1495c
1 changed files with 1843 additions and 719 deletions
|
|
@ -56,6 +56,9 @@ class Response implements MessageInterface
|
|||
if (!isset($data['result'])) {
|
||||
throw new InvalidArgumentException('Response must contain "result" field.');
|
||||
}
|
||||
if (!\is_array($data['result'])) {
|
||||
throw new InvalidArgumentException('Response "result" must be an array.');
|
||||
}
|
||||
|
||||
return new self($data['id'], $data['result']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue