Completed
Branch 0.4-dev (97f287)
by Evgenij
02:20
created

DisconnectException::lostRemoteConnection()   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
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
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\Exception;
11
12
use AsyncSockets\Socket\SocketInterface;
13
14
/**
15
 * Class DisconnectException. Socket has been unexpectedly disconnected
16
 */
17
class DisconnectException extends ConnectionException
18
{
19
    /**
20
     * Creates lost remote connection exception
21
     *
22
     * @param SocketInterface $socket
23
     *
24
     * @return DisconnectException
25
     */
26 2
    public static function lostRemoteConnection(SocketInterface $socket)
27
    {
28 2
        return new self($socket, 'Remote connection has been lost.');
29
    }
30
}
31