NotPolicy::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Deserialization\Policy;
6
7
use Chubbyphp\Deserialization\Denormalizer\DenormalizerContextInterface;
8
9
final class NotPolicy implements PolicyInterface
10
{
11
    /**
12
     * @var PolicyInterface
13
     */
14
    private $policy;
15
16
    public function __construct(PolicyInterface $policy)
17
    {
18
        $this->policy = $policy;
19 2
    }
20
21 2
    /**
22 2
     * @param object|mixed $object
23
     */
24
    public function isCompliant(DenormalizerContextInterface $context, $object): bool
25
    {
26
        return !$this->policy->isCompliant($context, $object);
27
    }
28
}
29