Response   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getBody() 0 3 1
A getResponse() 0 3 1
A getStatusCode() 0 3 1
A context() 0 3 1
A error() 0 3 1
A wasSuccessful() 0 3 1
A code() 0 3 1
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