Completed
Push — master ( 316225...77f0b6 )
by Filipe
04:26 queued 11s
created

ClientException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * This file is part of slick/http
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Http\Client\Exception;
11
12
use Exception;
13
use Psr\Http\Client\ClientExceptionInterface;
14
use Psr\Http\Message\RequestInterface;
15
use Throwable;
16
17
/**
18
 * ClientException
19
 *
20
 * @package Slick\Http\Client\Exception
21
 */
22
abstract class ClientException extends Exception implements ClientExceptionInterface
23
{
24
25
    /**
26
     * @var RequestInterface
27
     */
28
    private $request;
29
30
    /**
31
     * Creates a NetworkException
32
     *
33
     * @param RequestInterface $request
34
     * @param string $message
35
     */
36
    public function __construct(RequestInterface $request, $message = "")
37
    {
38
        parent::__construct($message);
39
        $this->request = $request;
40
    }
41
42
    /**
43
     * @inheritDoc
44
     */
45
    public function getRequest(): RequestInterface
46
    {
47
        return $this->request;
48
    }
49
}