Condition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 22
ccs 7
cts 9
cp 0.7778
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __toString() 0 3 1
A getMatcher() 0 3 1
A getValue() 0 3 1
1
<?php
2
/**
3
 * This file is part of Phiremock.
4
 *
5
 * Phiremock is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Lesser General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * Phiremock is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with Phiremock.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace Mcustiel\Phiremock\Domain\Condition;
20
21
use Mcustiel\Phiremock\Domain\Condition\Matchers\Matcher;
22
23
abstract class Condition
24
{
25
    private $matcher;
26
27 18
    public function __construct(Matcher $matcher)
28
    {
29 18
        $this->matcher = $matcher;
30 18
    }
31
32
    public function __toString()
33
    {
34
        return $this->getMatcher()->getName() . ' ' . $this->getValue()->asString();
35
    }
36
37 15
    public function getMatcher(): Matcher
38
    {
39 15
        return $this->matcher;
40
    }
41
42 18
    public function getValue(): ConditionValue
43
    {
44 18
        return $this->matcher->getCheckValue();
45
    }
46
}
47