RequestException::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Class RequestException
4
 *
5
 * @created      10.09.2018
6
 * @author       smiley <[email protected]>
7
 * @copyright    2018 smiley
8
 * @license      MIT
9
 */
10
11
namespace chillerlan\HTTP\Psr18;
12
13
use Throwable;
14
use Psr\Http\Client\RequestExceptionInterface;
15
use Psr\Http\Message\RequestInterface;
16
17
/**
18
 * @codeCoverageIgnore
19
 */
20
class RequestException extends ClientException implements RequestExceptionInterface{
21
22
	protected RequestInterface $request;
23
24
	/**
25
	 *
26
	 */
27
	public function __construct(string $message, RequestInterface $request, Throwable $previous = null){
28
		$this->request = $request;
29
30
		parent::__construct($message, 0, $previous);
31
	}
32
33
	/**
34
	 * @inheritDoc
35
	 */
36
	public function getRequest():RequestInterface{
37
		return $this->request;
38
	}
39
40
}
41