Completed
Push — master ( 5163d9...817b84 )
by Mike
07:06 queued 11s
created

willBeSatisfiedByEverythingBelow()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @link      http://phpdoc.org
12
 */
13
14
namespace Flyfinder\Specification;
15
16
/**
17
 * Class NotSpecification
18
 *
19
 * @psalm-immutable
20
 */
21
final class NotSpecification extends CompositeSpecification
22
{
23
    /** @var SpecificationInterface */
24
    private $wrapped;
25
26
    /**
27
     * Initializes the NotSpecification object
28
     */
29
    public function __construct(SpecificationInterface $wrapped)
30 2
    {
31
        $this->wrapped = $wrapped;
32 2
    }
33 2
34
    /**
35
     * {@inheritDoc}
36
     */
37
    public function isSatisfiedBy(array $value) : bool
38
    {
39
        return !$this->wrapped->isSatisfiedBy($value);
40 2
    }
41
42 2
    /** @inheritDoc */
43
    public function canBeSatisfiedBySomethingBelow(array $value) : bool
44
    {
45
        return !self::thatWillBeSatisfiedByEverythingBelow($this->wrapped, $value);
46
    }
47
48
    /** @inheritDoc */
49
    public function willBeSatisfiedByEverythingBelow(array $value) : bool
50
    {
51
        return !self::thatCanBeSatisfiedBySomethingBelow($this->wrapped, $value);
52
    }
53
}
54