1 | <?php |
||
8 | class SocketCluster |
||
9 | { |
||
10 | /** |
||
11 | * @var \WebSocket\Client |
||
12 | */ |
||
13 | protected $websocket; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $error; |
||
19 | |||
20 | /** |
||
21 | * Construct |
||
22 | * |
||
23 | * @param \WebSocket\Client $websocket |
||
24 | */ |
||
25 | 4 | public function __construct(Client $websocket) |
|
29 | |||
30 | /** |
||
31 | * Publish Channel |
||
32 | * |
||
33 | * @param string $channel |
||
34 | * @param mixed $data |
||
35 | * @param Closure|null $callback |
||
36 | * |
||
37 | * @return boolean |
||
38 | */ |
||
39 | 2 | public function publish($channel, $data, Closure $callback = null) |
|
48 | |||
49 | /** |
||
50 | * Emit Event |
||
51 | * |
||
52 | * @param string $event |
||
53 | * @param array $data |
||
54 | * |
||
55 | * @return boolean |
||
56 | */ |
||
57 | 2 | protected function emit($event, array $data) |
|
78 | |||
79 | /** |
||
80 | * Get Error |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | 1 | public function error() |
|
88 | } |
||
89 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.