Completed
Push — master ( ba7b2b...21cd4a )
by Woody
04:45
created

Action::getResponder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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 14
    public function __construct(
35
        $domain,
36
        $responder = null,
37
        $input = null
38
    ) {
39 14
        $this->domain = $domain;
40
41 14
        if ($responder) {
42 1
            $this->responder = $responder;
43 1
        }
44
45 14
        if ($input) {
46 1
            $this->input = $input;
47 1
        }
48 14
    }
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