Completed
Push — master ( c97103...9edfc5 )
by Evgenij
03:08
created

DisconnectedIo::isConnected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Async sockets
4
 *
5
 * @copyright Copyright (c) 2015-2017, Efimov Evgenij <[email protected]>
6
 *
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
namespace AsyncSockets\Socket\Io;
11
12
use AsyncSockets\Exception\NetworkSocketException;
13
use AsyncSockets\Frame\FramePickerInterface;
14
15
/**
16
 * Class DisconnectedIo
17
 */
18
class DisconnectedIo extends AbstractIo
19
{
20
    /** {@inheritdoc} */
21 12
    public function read(FramePickerInterface $picker, Context $context, $isOutOfBand)
22
    {
23 12
        throw new NetworkSocketException($this->socket, 'Can not start io operation on uninitialized socket.');
24
    }
25
26
    /** {@inheritdoc} */
27 12
    public function write($data, Context $context, $isOutOfBand)
28
    {
29 12
        throw new NetworkSocketException($this->socket, 'Can not start io operation on uninitialized socket.');
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 8
    public function isConnected()
36
    {
37 8
        return false;
38
    }
39
}
40