SafeNodeFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createNodeFromObjectValue() 0 3 1
A createNodeFromArrayValue() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\Jom;
4
5
final class SafeNodeFactory extends NodeFactory
6
{
7
    /**
8
     * @inheritdoc
9
     */
10 64
    protected function createNodeFromArrayValue(?Document $ownerDoc, array $array, int $flags): VectorNode
11
    {
12 64
        return $this->createArrayNodeFromPackedArray($array, $ownerDoc, $flags);
13
    }
14
15
    /**
16
     * @inheritdoc
17
     */
18 64
    protected function createNodeFromObjectValue(?Document $ownerDoc, object $object, int $flags): ?Node
19
    {
20 64
        return $this->createObjectNodeFromPropertyMap($object, $ownerDoc, $flags);
21
    }
22
}
23