Response   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 6
c 2
b 1
f 0
dl 0
loc 22
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __get() 0 3 1
A getContent() 0 3 1
A getStatus() 0 3 1
1
<?php
2
3
namespace JeroenG\Flickr;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
class Response
8
{
9
    protected array $contents;
10
11
    public function __construct(ResponseInterface $guzzleResponse)
12
    {
13
        $this->contents = unserialize($guzzleResponse->getBody()->getContents());
14
    }
15
16
    public function getStatus(): string
17
    {
18
        return $this->contents['stat'];
19
    }
20
21
    public function getContent(string $method): string
22
    {
23
        return $this->contents[$method]['_content'];
24
    }
25
26
    public function __get($variable)
27
    {
28
        return $this->contents[$variable];
29
    }
30
}
31