ArrayResponseTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace mb24dev\AmoCRM\ResponseTransformer;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
/**
8
 * Class ArrayJsonTransformer
9
 *
10
 * @package mb24dev\AmoCRM\ResponseTransformer
11
 */
12
class ArrayResponseTransformer implements ResponseTransformerInterface
13
{
14
    /**
15
     * @param ResponseInterface $response
16
     * @return string
17
     */
18
    public function transform(ResponseInterface $response)
19
    {
20
        $response->getBody()->rewind();
21
        return json_decode($response->getBody()->getContents(), true);
22
    }
23
24
}
25