CompositeSpecification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 36
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A andX() 0 4 1
A orX() 0 4 1
A not() 0 4 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