Passed
Push — master ( bc6688...f0a8fd )
by Dāvis
03:26
created

NotSpecification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Sludio\HelperBundle\Script\Specification;
4
5
/**
6
 * Not specification
7
 */
8
class NotSpecification extends CompositeSpecification
9
{
10
    /**
11
     * @var SpecificationInterface
12
     */
13
    private $specification;
14
15
    /**
16
     * Constructor
17
     *
18
     * @param SpecificationInterface $specification
19
     */
20
    public function __construct(SpecificationInterface $specification)
21
    {
22
        $this->specification = $specification;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function isSatisfiedBy($object)
29
    {
30
        return !$this->specification->isSatisfiedBy($object);
31
    }
32
}