Completed
Push — master ( c8064d...729f46 )
by Dmitry
02:44
created

ResponseDecodingException::getDetailsArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 15
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 15
loc 15
ccs 0
cts 10
cp 0
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Tools to use API as ActiveRecord for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart
6
 * @package   yii2-hiart
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\hiart;
12
13
class ResponseDecodingException extends ResponseErrorException
14
{
15
    /**
16
     * @return mixed
17
     */
18
    public function getName()
19
    {
20
        return 'Failed to decode the response';
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 View Code Duplication
    protected function getErrorInfo()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $request = $this->getRequest();
29
        $response = $this->getResponse();
30
31
        return [
32
            'statusCode' => $response->getStatusCode(),
33
            'responseData' => $response->getRawData(),
34
            'request' => [
35
                'method' => $request->getMethod(),
36
                'uri' => $request->getFullUri(),
37
                'body' => $request->getBody(),
38
            ],
39
        ];
40
    }
41
}
42