Completed
Push — master ( d5dbd1...2b4fd7 )
by Kévin
02:32
created

AbstractSpecification::getParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace RulerZ\Spec;
4
5
/**
6
 * Base class for specifications. Only provides a few usefull shortcuts.
7
 */
8
abstract class AbstractSpecification implements Specification
9
{
10
    /**
11
     * Create a conjunction with the current specification and another one.
12
     *
13
     * @param Specification $spec The other specification.
14
     *
15
     * @return Specification
16
     */
17
    public function andX(Specification $spec)
18
    {
19
        return new AndX([$this, $spec]);
20
    }
21
22
    /**
23
     * Create a disjunction with the current specification and another one.
24
     *
25
     * @param Specification $spec The other specification.
26
     *
27
     * @return Specification
28
     */
29
    public function orX(Specification $spec)
30
    {
31
        return new OrX([$this, $spec]);
32
    }
33
34
    /**
35
     * Negate the current specification.
36
     *
37
     * @return Specification
38
     */
39
    public function not()
40
    {
41
        return new Not($this);
42
    }
43
44
    /**
45
     * @inheritDoc
46
     */
47
    public function getParameters()
48
    {
49
        return [];
50
    }
51
}
52