__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace DansMaCulotte\PrestashopWebService\Exceptions;
4
5
class PrestashopWebServiceRequestException extends PrestashopWebServiceException
6
{
7
    protected static $label = 'This call to PrestaShop Web Services failed and returned an HTTP status of %d. That means: %s.';
8
9
    protected $response;
10
11
    public function __construct($message = null, $code = null, $response = null)
12
    {
13
        parent::__construct(sprintf(static::$label, $code, $message), $code);
14
15
        $this->response = $response;
16
    }
17
18
    public function hasResponse()
19
    {
20
        return isset($this->response) && !empty($this->response);
21
    }
22
23
    public function getResponse()
24
    {
25
        return $this->response;
26
    }
27
}
28