ApiInternalCallException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 51
ccs 0
cts 12
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 3 1
A __construct() 0 6 1
A getExceptionMessage() 0 3 1
A getPreviousException() 0 3 1
1
<?php
2
3
namespace Napp\Core\Api\Exceptions\Exceptions;
4
5
use Symfony\Component\HttpFoundation\Response;
6
7
/**
8
 * Class ApiInternalCallException.
9
 */
10
class ApiInternalCallException extends \RuntimeException
11
{
12
    /**
13
     * @var Response
14
     */
15
    protected $response;
16
17
    /**
18
     * @var string
19
     */
20
    protected $exceptionMessage;
21
22
    /**
23
     * @var \Exception
24
     */
25
    protected $previousException;
26
27
    /**
28
     * @param Response $response
29
     * @param string   $message
30
     */
31
    public function __construct(Response $response, $message = 'There was an error while processing your request')
32
    {
33
        $this->response = $response;
34
        $this->exceptionMessage = $message;
35
        $this->message = $message;
36
        $this->previousException = $response->exception;
0 ignored issues
show
Bug introduced by
The property exception does not seem to exist on Symfony\Component\HttpFoundation\Response.
Loading history...
37
    }
38
39
    /**
40
     * @return Response
41
     */
42
    public function getResponse()
43
    {
44
        return $this->response;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getExceptionMessage()
51
    {
52
        return $this->exceptionMessage;
53
    }
54
55
    /**
56
     * @return \Exception
57
     */
58
    public function getPreviousException()
59
    {
60
        return $this->previousException;
61
    }
62
}
63