Match::getExpected()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Peridot\Leo\Matcher;
4
5
/**
6
 * A Match is the result of MatcherInterface::match($actual).
7
 *
8
 * @package Peridot\Leo\Matcher
9
 */
10
class Match
11
{
12
    /**
13
     * @var bool
14
     */
15
    protected $match;
16
17
    /**
18
     * @var mixed
19
     */
20
    protected $expected;
21
22
    /**
23
     * @var mixed
24
     */
25
    protected $actual;
26
27
    /**
28
     * @var bool
29
     */
30
    protected $isNegated;
31
32
    /**
33
     * @param bool  $isMatch
34
     * @param mixed $expected
35
     * @param mixed $actual
36
     * @param bool  $isNegated
37
     */
38
    public function __construct($isMatch, $expected, $actual, $isNegated)
39
    {
40
        $this->match = $isMatch;
41
        $this->expected = $expected;
42
        $this->actual = $actual;
43
        $this->isNegated = $isNegated;
44
    }
45
46
    /**
47
     * Return whether or not a match succeeded.
48
     *
49
     * @return bool
50
     */
51
    public function isMatch()
52
    {
53
        return $this->match;
54
    }
55
56
    /**
57
     * Get the actual value used in the match.
58
     *
59
     * @return mixed
60
     */
61
    public function getActual()
62
    {
63
        return $this->actual;
64
    }
65
66
    /**
67
     * Get the expected value used in the match.
68
     *
69
     * @return mixed
70
     */
71
    public function getExpected()
72
    {
73
        return $this->expected;
74
    }
75
76
    /**
77
     * Returns whether or not the match was negated.
78
     *
79
     * @return bool
80
     */
81
    public function isNegated()
82
    {
83
        return $this->isNegated;
84
    }
85
86
    /**
87
     * Set the actual value used in the match.
88
     *
89
     * @param  mixed $actual
90
     * @return $this
91
     */
92
    public function setActual($actual)
93
    {
94
        $this->actual = $actual;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Set the expected value used in the match.
101
     *
102
     * @param  mixed $expected
103
     * @return $this
104
     */
105
    public function setExpected($expected)
106
    {
107
        $this->expected = $expected;
108
109
        return $this;
110
    }
111
}
112