ApiHttpRequestException   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setError() 0 3 1
A getError() 0 3 1
A setDetailedMessage() 0 3 1
A getDetailedMessage() 0 7 2
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\AfterPay\Business\Exception;
9
10
use Exception;
11
use Generated\Shared\Transfer\AfterPayApiResponseErrorTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...piResponseErrorTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
class ApiHttpRequestException extends Exception
14
{
15
    /**
16
     * @var \Generated\Shared\Transfer\AfterPayApiResponseErrorTransfer
17
     */
18
    protected $error;
19
20
    /**
21
     * @var string
22
     */
23
    protected $detailedMessage;
24
25
    /**
26
     * @param \Generated\Shared\Transfer\AfterPayApiResponseErrorTransfer $error
27
     *
28
     * @return void
29
     */
30
    public function setError(AfterPayApiResponseErrorTransfer $error): void
31
    {
32
        $this->error = $error;
33
    }
34
35
    /**
36
     * @return \Generated\Shared\Transfer\AfterPayApiResponseErrorTransfer
37
     */
38
    public function getError(): AfterPayApiResponseErrorTransfer
39
    {
40
        return $this->error;
41
    }
42
43
    /**
44
     * @param string $message
45
     *
46
     * @return void
47
     */
48
    public function setDetailedMessage(string $message): void
49
    {
50
        $this->detailedMessage = $message;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getDetailedMessage(): string
57
    {
58
        if (empty($this->detailedMessage)) {
59
            return parent::getMessage();
60
        }
61
62
        return $this->detailedMessage;
63
    }
64
}
65