Completed
Push — master ( 0757af...2896cb )
by Barry vd.
13:12
created

Exception::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Omnipay\Common\Http;
4
5
use Psr\Http\Message\RequestInterface;
6
use Throwable;
7
8
abstract class Exception extends \RuntimeException
9
{
10
    /** @var RequestInterface  */
11
    protected $request;
12
13 6
    public function __construct(string $message, RequestInterface $request, Throwable $previous = null)
14
    {
15 6
        $this->request = $request;
16
17 6
        parent::__construct($message, 0, $previous);
18 6
    }
19
20
    /**
21
     * Returns the request.
22
     *
23
     * The request object MAY be a different object from the one passed to ClientInterface::sendRequest()
24
     *
25
     * @return RequestInterface
26
     */
27
    public function getRequest(): RequestInterface
28
    {
29
        return $this->getRequest();
30
    }
31
}
32