NotSpecification   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A isSatisfiedBy() 0 3 1
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