SocketException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
/**
4
 * This file is a part of Woketo package.
5
 *
6
 * (c) Nekland <[email protected]>
7
 *
8
 * For the full license, take a look to the LICENSE file
9
 * on the root directory of this project
10
 */
11
12
namespace Nekland\Woketo\Exception;
13
14
class SocketException extends \Exception
15
{
16
    /**
17
     * SocketException constructor.
18
     * @param string   $message Error message
19
     * @param resource $socket  Socket experimenting the error.
20
     */
21
    public function __construct($message, $socket)
22
    {
23
        parent::__construct($message . ' (error: ' . \socket_strerror(\socket_last_error($socket)) . ')');
24
    }
25
}
26