Completed
Push — master ( ba1c59...9de6f9 )
by Gareth
03:03
created

MiddlewareResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 72.72%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
ccs 8
cts 11
cp 0.7272
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A newResponse() 0 5 1
A getResponse() 0 4 1
A setResponse() 0 6 1
1
<?php
2
3
namespace garethp\ews\API;
4
5
class MiddlewareResponse
6
{
7
    protected $response;
8
    
9 27
    protected function __construct($response = null)
10
    {
11 27
        $this->response = $response;
12 27
    }
13
14 27
    public static function newResponse($response = null)
15
    {
16 27
        $response = new static($response);
17 27
        return $response;
18
    }
19
20 27
    public function getResponse()
21
    {
22 27
        return $this->response;
23
    }
24
25
    public function setResponse($response)
26
    {
27
        $this->response = $response;
28
29
        return $this;
30
    }
31
}
32