ErrorResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace CodeCloud\Bundle\ShopifyBundle\Api\Response;
3
4
use GuzzleHttp\Exception\ClientException;
5
use Psr\Http\Message\ResponseInterface as PsrResponse;
6
7
class ErrorResponse implements ResponseInterface
8
{
9
    /**
10
     * @var PsrResponse
11
     */
12
    private $response;
13
14
    /**
15
     * @var ClientException
16
     */
17
    private $exception;
18
19
    /**
20
     * @param PsrResponse $response
21
     * @param $exception
22
     */
23
    public function __construct(PsrResponse $response, ClientException $exception)
24
    {
25
        $this->response  = $response;
26
        $this->exception = $exception;
27
    }
28
29
    /**
30
     * @param null $item
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $item is correct as it would always require null to be passed?
Loading history...
31
     * @param null $default
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $default is correct as it would always require null to be passed?
Loading history...
32
     * @return mixed
33
     */
34
    public function get($item = null, $default = null)
35
    {
36
        return 'An error occurred while processing the request.';
37
    }
38
39
    /**
40
     * @return PsrResponse
41
     */
42
    public function getHttpResponse()
43
    {
44
        return $this->response;
45
    }
46
47
    /**
48
     * @return bool
49
     */
50
    public function successful()
51
    {
52
        return false;
53
    }
54
}
55