RequestException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
declare(strict_types=1);
3
4
namespace Yproximite\Api\Exception;
5
6
use Psr\Http\Message\RequestInterface;
7
8
/**
9
 * Class RequestException
10
 */
11 View Code Duplication
class RequestException extends \RuntimeException implements ExceptionInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @var RequestInterface
15
     */
16
    private $request;
17
18
    /**
19
     * @param string           $message
20
     * @param RequestInterface $request
21
     * @param \Exception|null  $previous
22
     */
23
    public function __construct(
24
        string $message,
25
        RequestInterface $request,
26
        \Exception $previous = null
27
    ) {
28
        parent::__construct($message, 0, $previous);
29
30
        $this->request = $request;
31
    }
32
33
    /**
34
     * @return RequestInterface
35
     */
36
    public function getRequest(): RequestInterface
37
    {
38
        return $this->request;
39
    }
40
}
41