Completed
Push — master ( 8f0dec...db4c32 )
by Thibaud
02:33
created

NotSpecification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 21
wmc 2
lcom 1
cbo 1
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isSatisfiedBy() 0 4 1
1
<?php
2
3
namespace Alchemy\Pipeline\Specification;
4
5
use Alchemy\Pipeline\Specification;
6
use Alchemy\Resource\Resource;
7
8
class NotSpecification implements Specification
9
{
10
    /**
11
     * @var Specification
12
     */
13
    private $negatedSpecification;
14
15 12
    public function __construct(Specification $specificationToNegate)
16
    {
17 12
        $this->negatedSpecification = $specificationToNegate;
18 12
    }
19
20
    /**
21
     * @param \Alchemy\Resource\Resource $resource
22
     * @return bool
23
     */
24 8
    public function isSatisfiedBy(Resource $resource)
25
    {
26 8
        return ! $this->negatedSpecification->isSatisfiedBy($resource);
27
    }
28
}
29