AbstractSpecification::getParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RulerZ\Spec;
6
7
/**
8
 * Base class for specifications. Only provides a few usefull shortcuts.
9
 */
10
abstract class AbstractSpecification implements Specification
11
{
12
    /**
13
     * Create a conjunction with the current specification and another one.
14
     *
15
     * @param Specification $spec The other specification.
16
     */
17
    public function andX(Specification $spec): AndX
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
    public function orX(Specification $spec): OrX
28
    {
29
        return new OrX([$this, $spec]);
30
    }
31
32
    /**
33
     * Negate the current specification.
34
     *
35
     * @return Not
36
     */
37
    public function not(): Not
38
    {
39
        return new Not($this);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getParameters(): array
46
    {
47
        return [];
48
    }
49
}
50