1 | <?php |
||
16 | class HttpServer implements HttpServerInterface, NetworkComponentAwareInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var NetworkComponentInterface |
||
20 | */ |
||
21 | protected $httpServer; |
||
22 | |||
23 | /** |
||
24 | * @var HttpDriverInterface |
||
25 | */ |
||
26 | protected $httpDriver; |
||
27 | |||
28 | /** |
||
29 | * @param NetworkComponentAwareInterface|null $aware |
||
30 | * @param NetworkComponentInterface|null $component |
||
31 | */ |
||
32 | 65 | public function __construct(NetworkComponentAwareInterface $aware = null, NetworkComponentInterface $component = null) |
|
42 | |||
43 | /** |
||
44 | * |
||
45 | */ |
||
46 | public function __destruct() |
||
51 | |||
52 | /** |
||
53 | * @override |
||
54 | * @inheritDoc |
||
55 | */ |
||
56 | 1 | public function getDriver() |
|
60 | |||
61 | /** |
||
62 | * @override |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | 23 | public function setComponent(NetworkComponentInterface $component = null) |
|
69 | |||
70 | /** |
||
71 | * @override |
||
72 | * @inheritDoc |
||
73 | */ |
||
74 | 3 | public function getComponent() |
|
78 | |||
79 | /** |
||
80 | * @override |
||
81 | * @inheritDoc |
||
82 | */ |
||
83 | 4 | public function handleConnect(NetworkConnectionInterface $conn) |
|
89 | |||
90 | /** |
||
91 | * @override |
||
92 | * @inheritDoc |
||
93 | */ |
||
94 | 5 | public function handleDisconnect(NetworkConnectionInterface $conn) |
|
101 | |||
102 | /** |
||
103 | * @override |
||
104 | * @inheritDoc |
||
105 | */ |
||
106 | 6 | public function handleMessage(NetworkConnectionInterface $conn, NetworkMessageInterface $message) |
|
137 | |||
138 | /** |
||
139 | * @override |
||
140 | * @inheritDoc |
||
141 | */ |
||
142 | 2 | public function handleError(NetworkConnectionInterface $conn, $ex) |
|
153 | |||
154 | /** |
||
155 | * Close a connection with an HTTP response. |
||
156 | * |
||
157 | * @param NetworkConnectionInterface $conn |
||
158 | * @param int $code |
||
159 | * @return null |
||
160 | */ |
||
161 | 1 | protected function close(NetworkConnectionInterface $conn, $code = 400) |
|
168 | } |
||
169 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: