Action::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 9.7666
c 0
b 0
f 0
cc 3
nc 4
nop 3
crap 3
1
<?php
2
3
namespace Equip;
4
5
use Equip\Input;
6
use Equip\Responder\ChainedResponder;
7
8
class Action
9
{
10
    /**
11
     * The domain specification.
12
     *
13
     * @var DomainInterface
14
     */
15
    protected $domain;
16
17
    /**
18
     * The responder specification.
19
     *
20
     * @var ResponderInterface
21
     */
22
    protected $responder = ChainedResponder::class;
23
24
    /**
25
     * The input specification.
26
     *
27
     * @var InputInterface
28
     */
29
    protected $input = Input::class;
30
31
    /**
32
     * @inheritDoc
33
     */
34 15
    public function __construct(
35
        $domain,
36
        $responder = null,
37
        $input = null
38
    ) {
39 15
        $this->domain = $domain;
40
41 15
        if ($responder) {
42 1
            $this->responder = $responder;
43 1
        }
44
45 15
        if ($input) {
46 1
            $this->input = $input;
47 1
        }
48 15
    }
49
50
    /**
51
     * Returns the domain specification.
52
     *
53
     * @return DomainInterface
54
     */
55 3
    public function getDomain()
56
    {
57 3
        return $this->domain;
58
    }
59
60
    /**
61
     * Returns the responder specification.
62
     *
63
     * @return ResponderInterface
64
     */
65 2
    public function getResponder()
66
    {
67 2
        return $this->responder;
68
    }
69
70
    /**
71
     * Returns the input specification.
72
     *
73
     * @return InputInterface
74
     */
75 2
    public function getInput()
76
    {
77 2
        return $this->input;
78
    }
79
}
80