NotSpecification::isSatisfiedBy()   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
class NotSpecification extends AbstractSpecification implements Specification
6
{
7
    /** @var Specification */
8
    private $specification;
9
10
    /**
11
     * Constructor.
12
     *
13
     * @param Specification $specification
14
     */
15 9
    public function __construct(Specification $specification)
16
    {
17 9
        $this->specification = $specification;
18 9
    }
19
20
    /**
21
     * @param $candidate
22
     *
23
     * @return bool
24
     */
25 3
    public function isSatisfiedBy($candidate)
26
    {
27 3
        return !$this->specification->isSatisfiedBy($candidate);
28
    }
29
}
30