CompositeSpecification::not()   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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GBProd\Specification;
6
7
/**
8
 * Abstract composite specification implementation
9
 *
10
 * @author gbprod <[email protected]>
11
 */
12
abstract class CompositeSpecification implements Specification
13
{
14
    /**
15
     * Chain with AndX specification
16
     *
17
     * @param Specification $specification
18
     *
19
     * @return AndX
20
     */
21 2
    public function andX(Specification $specification): AndX
22
    {
23 2
        return new AndX($this, $specification);
24
    }
25
26
    /**
27
     * Chain with OrX specification
28
     *
29
     * @param Specification $specification
30
     *
31
     * @return OrX
32
     */
33 2
    public function orX(Specification $specification): OrX
34
    {
35 2
        return new OrX($this, $specification);
36
    }
37
38
    /**
39
     * Chain with Not specification
40
     *
41
     * @return Not
42
     */
43 2
    public function not(): Not
44
    {
45 2
        return new Not($this);
46
    }
47
}
48