AbstractSpecification::andSatisfies()   A
last analyzed

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
nc 1
cc 1
eloc 2
nop 1
crap 1
1
<?php
2
3
namespace RemiSan\Specification;
4
5
abstract class AbstractSpecification implements Specification
6
{
7
    /**
8
     * @param $candidate
9
     *
10
     * @return bool
11
     */
12
    abstract public function isSatisfiedBy($candidate);
13
14
    /**
15
     * @param Specification $other
16
     *
17
     * @return AndSpecification
18
     */
19 3
    public function andSatisfies(Specification $other)
20
    {
21 3
        return new AndSpecification($this, $other);
22
    }
23
24
    /**
25
     * @param Specification $other
26
     *
27
     * @return OrSpecification
28
     */
29 3
    public function orSatisfies(Specification $other)
30
    {
31 3
        return new OrSpecification($this, $other);
32
    }
33
34
    /**
35
     * @return NotSpecification
36
     */
37 3
    public function not()
38
    {
39 3
        return new NotSpecification($this);
40
    }
41
}
42