NetworkException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRequest() 0 2 1
1
<?php
2
/**
3
 * Class NetworkException
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\NetworkExceptionInterface;
15
use Psr\Http\Message\RequestInterface;
16
17
/**
18
 * @codeCoverageIgnore
19
 */
20
class NetworkException extends ClientException implements NetworkExceptionInterface{
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