Completed
Push — master ( 7656a5...de6dfd )
by David
06:46
created

HttpClientNoMatchException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRequest() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Http\Client\Common\Exception;
6
7
use Http\Client\Exception\TransferException;
8
use Psr\Http\Message\RequestInterface;
9
10
/**
11
 * Thrown when a http client match in the HTTPClientRouter.
12
 *
13
 * @author Tobias Nyholm <[email protected]>
14
 */
15
final class HttpClientNoMatchException extends TransferException
16
{
17
    private $request;
18
19 2
    public function __construct(string $message, RequestInterface $request, \Exception $previous = null)
20
    {
21 2
        $this->request = $request;
22
23 2
        parent::__construct($message, 0, $previous);
24 2
    }
25
26
    public function getRequest(): RequestInterface
27
    {
28
        return $this->request;
29
    }
30
}
31