Response::context()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace ElasticEmail;
4
5
abstract class Response
6
{
7
    /** @var  \GuzzleHttp\Psr7\Response */
8
    protected $response;
9
10
    public function getResponse()
11
    {
12
        return $this->response;
13
    }
14
15
    public function context()
16
    {
17
        return $this->getBody()->Context;
18
    }
19
20
    public function getBody()
21
    {
22
        return json_decode((string)$this->response->getBody());
23
    }
24
25
    public function wasSuccessful()
26
    {
27
        return $this->getBody()->success;
28
    }
29
30
    public function getStatusCode()
31
    {
32
        return $this->response->getStatusCode();
33
    }
34
35
    public function code()
36
    {
37
        return $this->getBody()->Code;
38
    }
39
40
    public function error()
41
    {
42
        return $this->getBody()->error;
43
    }
44
}
45