1 | <?php |
||
6 | abstract class BaseTransport implements TransportInterface |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * @var resource|null|false |
||
11 | */ |
||
12 | protected $target; |
||
13 | |||
14 | /** @var string - udp:// tcp:// */ |
||
15 | protected $schema = ''; |
||
16 | |||
17 | protected $errorNumber = 0; |
||
18 | protected $errorMessage = ''; |
||
19 | |||
20 | /** @var Writer */ |
||
21 | protected $writer; |
||
22 | |||
23 | 3 | public function __construct(Writer $writer = null) |
|
27 | |||
28 | /** |
||
29 | * @param string $buffer |
||
30 | * @param int|null $length - записать число байт в сокет |
||
31 | * |
||
32 | * @return false|int число записанных байт или false |
||
33 | */ |
||
34 | 3 | public function write(string $buffer, int $length = null): int |
|
38 | |||
39 | 3 | public function isConnected(): bool |
|
43 | |||
44 | 3 | public function close(): void |
|
49 | } |
||
50 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.