Completed
Push — master ( e1ce3b...f144d1 )
by Anton
14s queued 12s
created

src/Parser/EmbeddedNode.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\ORM\Parser;
13
14
use Cycle\ORM\Exception\ParserException;
15
16
/**
17
 * @internal
18
 */
19
final class EmbeddedNode extends AbstractNode
20
{
21
    /**
22
     * @param array $data
23
     */
24
    protected function push(array &$data): void
25
    {
26
        if ($this->parent === null) {
27
            throw new ParserException('Unable to register data tree, parent is missing');
28
        }
29
30
        $this->parent->mount(
31
            $this->container,
32
            $this->outerKey,
0 ignored issues
show
It seems like $this->outerKey can also be of type null; however, parameter $key 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

32
            /** @scrutinizer ignore-type */ $this->outerKey,
Loading history...
33
            self::LAST_REFERENCE,
34
            $data
35
        );
36
    }
37
}
38