1 | <?php |
||
6 | abstract class BaseTransport implements TransportInterface |
||
7 | { |
||
8 | /** @var resource|null|false */ |
||
9 | protected $target; |
||
10 | /** @var string */ |
||
11 | protected $schema = ''; |
||
12 | /** @var WriterInterface */ |
||
13 | protected $writer; |
||
14 | |||
15 | 16 | public function __construct(WriterInterface $writer = null) |
|
19 | |||
20 | 4 | public function getWriter(): WriterInterface |
|
24 | |||
25 | /** |
||
26 | * @param string $buffer |
||
27 | * @param int|null $length - записать число байт в сокет |
||
28 | * |
||
29 | * @return false|int число записанных байт или false |
||
30 | */ |
||
31 | 16 | public function write(string $buffer, int $length = null): int |
|
35 | |||
36 | 12 | public function isConnected(): bool |
|
40 | |||
41 | 16 | public function close(): void |
|
46 | } |
||
47 |
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.