Completed
Push — master ( 649e1f...bdce94 )
by Gareth
04:10
created

MiddlewareRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 48
ccs 19
cts 19
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A newRequest() 0 5 1
A getRequest() 0 4 1
A setRequest() 0 6 1
A getName() 0 4 1
A getOptions() 0 4 1
A getArguments() 0 4 1
1
<?php
2
3
namespace garethp\ews\API;
4
5
class MiddlewareRequest
6
{
7
    protected $name;
8
9
    protected $arguments;
10
11
    protected $options;
12
13 28
    protected function __construct($name, $arguments, $options)
14
    {
15 28
        $this->name = $name;
16 28
        $this->arguments = $arguments;
17 28
        $this->options = $options;
18 28
    }
19
20 28
    public static function newRequest($name, $arguments, $options)
21
    {
22 28
        $request = new static($name, $arguments, $options);
23 28
        return $request;
24
    }
25
26 28
    public function getRequest()
27
    {
28 28
        return $this->arguments[0];
29
    }
30
31 28
    public function setRequest($request)
32
    {
33 28
        $this->arguments[0] = $request;
34
35 28
        return $this;
36
    }
37
38 28
    public function getName()
39
    {
40 28
        return $this->name;
41
    }
42
43 28
    public function getOptions()
44
    {
45 28
        return $this->options;
46
    }
47
48 28
    public function getArguments()
49
    {
50 28
        return $this->arguments;
51
    }
52
}
53