NotPolicy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 18
ccs 3
cts 3
cp 1
rs 10
wmc 2

2 Methods

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