NotSpecification::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Anfischer\Specification;
5
6
class NotSpecification extends Specification
7
{
8
    /**
9
     * @var Specification
10
     */
11
    private $specification;
12
13
    /**
14
     * @param Specification $specification
15
     */
16 4
    public function __construct(Specification $specification)
17
    {
18 4
        $this->specification = $specification;
19 4
    }
20
21
    /**
22
     * @param mixed $object
23
     * @return bool
24
     */
25 4
    public function isSatisfiedBy($object): bool
26
    {
27 4
        return ! $this->specification->isSatisfiedBy($object);
28
    }
29
}
30