Completed
Push — master ( ec4c56...bd8716 )
by David
04:49
created

NetworkException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Http\Client\Exception;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Client\NetworkExceptionInterface as PsrNetworkException;
7
8
/**
9
 * Thrown when the request cannot be completed because of network issues.
10
 *
11
 * There is no response object as this exception is thrown when no response has been received.
12
 *
13
 * @author Márk Sági-Kazár <[email protected]>
14
 */
15
class NetworkException extends TransferException implements PsrNetworkException
16
{
17
    use RequestAwareTrait;
18
19
    /**
20
     * @param string           $message
21
     * @param RequestInterface $request
22
     * @param \Exception|null  $previous
23
     */
24 6
    public function __construct($message, RequestInterface $request, \Exception $previous = null)
25
    {
26 6
        $this->setRequest($request);
27
28 6
        parent::__construct($message, 0, $previous);
29 6
    }
30
}
31