Skip to content

Commit 7818d4b

Browse files
authored
Changed sender which only support push and disconnect. (#2065)
* Changed sender which only support `push` and `disconnect`. * Added document.
1 parent 8693623 commit 7818d4b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Sender.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/**
2323
* @method push(int $fd, $data, int $opcode = null, $finish = null)
24-
* @method close(int $fd, bool $reset = null)
24+
* @method disconnect(int $fd, int $code = null, string $reason = null)
2525
*/
2626
class Sender
2727
{
@@ -117,13 +117,10 @@ public function setResponse(int $fd, ?Response $response): void
117117

118118
public function getFdAndMethodFromProxyMethod(string $method, array $arguments): array
119119
{
120-
if (! in_array($method, ['push', 'send', 'sendto', 'close'])) {
120+
if (! in_array($method, ['push', 'disconnect'])) {
121121
throw new InvalidMethodException(sprintf('Method [%s] is not allowed.', $method));
122122
}
123123

124-
if ($method !== 'close') {
125-
$method = 'push';
126-
}
127124
return [(int) $arguments[0], $method];
128125
}
129126

0 commit comments

Comments
 (0)