Passed
Push — 2.x ( 0b5227...cb81b7 )
by butschster
16:17
created

EmbeddedNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 13
ccs 5
cts 6
cp 0.8333
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A push() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\ORM\Parser;
6
7
use Cycle\ORM\Exception\ParserException;
8
9
/**
10
 * @internal
11
 */
12
final class EmbeddedNode extends AbstractNode
13
{
14 264
    protected function push(array &$data): void
15
    {
16 264
        if ($this->parent === null) {
17
            throw new ParserException('Unable to register data tree, parent is missing');
18
        }
19
20 264
        $this->parent->mount(
21 264
            $this->container,
0 ignored issues
show
Bug introduced by
It seems like $this->container can also be of type null; however, parameter $container of Cycle\ORM\Parser\AbstractNode::mount() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

21
            /** @scrutinizer ignore-type */ $this->container,
Loading history...
22 264
            $this->indexName,
0 ignored issues
show
Bug introduced by
It seems like $this->indexName can also be of type null; however, parameter $index of Cycle\ORM\Parser\AbstractNode::mount() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
            /** @scrutinizer ignore-type */ $this->indexName,
Loading history...
23
            self::LAST_REFERENCE,
24
            $data
25
        );
26
    }
27
}
28