ObjectComparison   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isFieldEqual() 0 10 1
1
<?php
2
3
namespace PhpAbac\Comparison;
4
5
class ObjectComparison extends AbstractComparison
6
{
7 1
    public function isFieldEqual(string $attributeId, $value, array $extraData = []): bool
8
    {
9 1
        $attributeManager = $this->comparisonManager->getAttributeManager();
10
        // Create an attribute out of the extra data we have and compare its retrieved value to the expected one
11 1
        return $attributeManager->retrieveAttribute(
12 1
            $attributeManager->getAttribute($attributeId),
13 1
            null,
14 1
            $extraData['resource']
15 1
        ) === $value;
16
    }
17
}
18