1 | <?php |
||
7 | class SwooleFastCGIWrapper extends Swoole implements ServerInterface |
||
8 | { |
||
9 | protected $max_request = 0; |
||
10 | protected $request_count = 0; |
||
11 | |||
12 | 4 | public function __construct($host, $port) |
|
16 | |||
17 | 4 | public function start() |
|
18 | { |
||
19 | 4 | if (!empty($this->handler_config)) { |
|
20 | 4 | if (isset($this->handler_config['max_request'])) { |
|
21 | 4 | $this->max_request = $this->handler_config['max_request']; |
|
22 | 2 | } |
|
23 | 4 | $this->handler_config['max_request'] = 0; |
|
24 | 4 | $this->server->set($this->handler_config); |
|
|
|||
25 | 2 | } |
|
26 | |||
27 | 4 | $this->callbacks = array_merge([ |
|
28 | 4 | 'Receive' => [$this, 'onReceive'], |
|
29 | 4 | ], $this->callbacks); |
|
30 | |||
31 | 4 | return parent::start(); |
|
32 | } |
||
33 | |||
34 | 4 | public function onReceive($serv, $fd, $from_id, $data) |
|
38 | |||
39 | 4 | public function requestCallback($psrRequest) |
|
43 | |||
44 | 4 | public function sendCallback($fd, $payload) |
|
48 | |||
49 | 4 | public function closeCallback($fd) |
|
50 | { |
||
51 | 4 | $this->server->close($fd); |
|
52 | 4 | if ($this->max_request) { |
|
53 | 4 | if ($this->request_count++ > $this->max_request) { |
|
54 | $this->server->stop(); // @codeCoverageIgnore |
||
55 | } |
||
56 | 2 | } |
|
57 | |||
58 | 4 | } |
|
59 | |||
60 | 4 | public function onWorkerStart($serv, $worker_id) |
|
70 | } |
||
71 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.