Passed
Push — master ( 4e34bd...29d761 )
by Alexpts
02:16
created

UdpSocket::splitToChunks()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 10
cp 0
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
declare(strict_types=1);
3
4
namespace PTS\Transport;
5
6
class UdpSocket extends Socket
7
{
8
9
    /** @var bool */
10
    protected $isConnected = false;
11
    /** @var string  */
12
    protected $socketPrefix = 'udp://';
13
14
    public function connect(string $address, int $port = 0, array $options = []): TransportInterface
15
    {
16
        $this->isConnected = true;
17
        return parent::connect($address, $port, $options);
18
    }
19
20
    public function isConnected(): bool
21
    {
22
        return $this->isConnected;
23
    }
24
25
    public function close(): void
26
    {
27
        parent::close();
28
        $this->isConnected = false;
29
    }
30
}
31