PrestashopWebServiceRequestException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 23
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A hasResponse() 0 4 2
A getResponse() 0 4 1
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