1 | <?php |
||
23 | abstract class AbstractSocket implements SocketInterface |
||
24 | { |
||
25 | /** |
||
26 | * Tcp socket type |
||
27 | */ |
||
28 | const SOCKET_TYPE_TCP = 'tcp'; |
||
29 | |||
30 | /** |
||
31 | * Udp socket type |
||
32 | */ |
||
33 | const SOCKET_TYPE_UDP = 'udp'; |
||
34 | |||
35 | /** |
||
36 | * Unix socket type |
||
37 | */ |
||
38 | const SOCKET_TYPE_UNIX = 'unix'; |
||
39 | |||
40 | /** |
||
41 | * Unix datagram socket type |
||
42 | */ |
||
43 | const SOCKET_TYPE_UDG = 'udg'; |
||
44 | |||
45 | /** |
||
46 | * Unknown type of socket |
||
47 | */ |
||
48 | const SOCKET_TYPE_UNKNOWN = ''; |
||
49 | |||
50 | /** |
||
51 | * Array of socket resources |
||
52 | * |
||
53 | * @var resource[] |
||
54 | */ |
||
55 | private static $resources; |
||
56 | |||
57 | /** |
||
58 | * Flag if we have shutdown function |
||
59 | * |
||
60 | * @var bool |
||
61 | */ |
||
62 | private static $hasShutdownClearer = false; |
||
63 | |||
64 | /** |
||
65 | * Gracefully disconnects sockets when application terminating |
||
66 | * |
||
67 | * @return void |
||
68 | */ |
||
69 | public static function shutdownSocketCleaner() |
||
82 | |||
83 | /** |
||
84 | * Creates socket object from given resource |
||
85 | * |
||
86 | * @param resource $resource Opened socket resource |
||
87 | * |
||
88 | * @return SocketInterface |
||
89 | */ |
||
90 | public static function fromResource($resource) |
||
146 | |||
147 | /** |
||
148 | * This socket resource |
||
149 | * |
||
150 | * @var resource |
||
151 | */ |
||
152 | private $resource; |
||
153 | |||
154 | /** |
||
155 | * I/O interface |
||
156 | * |
||
157 | * @var IoInterface |
||
158 | */ |
||
159 | private $ioInterface; |
||
160 | |||
161 | /** |
||
162 | * Socket address |
||
163 | * |
||
164 | * @var string |
||
165 | */ |
||
166 | private $remoteAddress; |
||
167 | |||
168 | /** |
||
169 | * Context for this socket |
||
170 | * |
||
171 | * @var Context |
||
172 | */ |
||
173 | private $context; |
||
174 | |||
175 | /** |
||
176 | * AbstractSocket constructor. |
||
177 | */ |
||
178 | 139 | public function __construct() |
|
188 | |||
189 | /** |
||
190 | * Set disconnected state for socket |
||
191 | * |
||
192 | * @return void |
||
193 | */ |
||
194 | 139 | private function setDisconnectedState() |
|
198 | |||
199 | /** {@inheritdoc} */ |
||
200 | 75 | public function open($address, $context = null) |
|
209 | |||
210 | /** {@inheritdoc} */ |
||
211 | 12 | public function close() |
|
222 | |||
223 | /** {@inheritdoc} */ |
||
224 | 31 | public function read(FramePickerInterface $picker, $isOutOfBand = false) |
|
233 | |||
234 | /** {@inheritdoc} */ |
||
235 | 10 | public function write($data, $isOutOfBand = false) |
|
244 | |||
245 | /** {@inheritdoc} */ |
||
246 | 45 | public function getStreamResource() |
|
250 | |||
251 | /** |
||
252 | * @inheritDoc |
||
253 | */ |
||
254 | 10 | public function __toString() |
|
264 | |||
265 | /** |
||
266 | * Create certain socket resource |
||
267 | * |
||
268 | * @param string $address Network address to open in form transport://path:port |
||
269 | * @param resource $context Valid stream context created by function stream_context_create or null |
||
270 | * |
||
271 | * @return resource |
||
272 | */ |
||
273 | abstract protected function createSocketResource($address, $context); |
||
274 | |||
275 | /** |
||
276 | * Create I/O interface for socket |
||
277 | * |
||
278 | * @param string $type Type of this socket, one of SOCKET_TYPE_* consts |
||
279 | * @param string $address Address passed to open method |
||
280 | * |
||
281 | * @return IoInterface |
||
282 | */ |
||
283 | abstract protected function createIoInterface($type, $address); |
||
284 | |||
285 | /** |
||
286 | * Get current socket type |
||
287 | * |
||
288 | * @return string One of SOCKET_TYPE_* consts |
||
289 | */ |
||
290 | 64 | private function resolveSocketType() |
|
314 | |||
315 | /** |
||
316 | * Set up internal data for given resource |
||
317 | * |
||
318 | * @param resource $resource Socket resource |
||
319 | * @param string $address Socket address |
||
320 | * |
||
321 | * @return void |
||
322 | */ |
||
323 | 69 | private function setupSocketResource($resource, $address) |
|
350 | |||
351 | /** |
||
352 | * @inheritDoc |
||
353 | */ |
||
354 | 8 | public function isConnected() |
|
358 | } |
||
359 |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.