Completed
Push — wip-public-release ( 7c11a5...54ec9d )
by Bogdan
05:19
created

ObjectValueHydrator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/php-v8-js-sandbox PHP library.
5
 *
6
 * Copyright (c) 2016-2017 Bogdan Padalko <[email protected]>
7
 *
8
 * Licensed under the MIT license: http://opensource.org/licenses/MIT
9
 *
10
 * For the full copyright and license information, please view the
11
 * LICENSE file that was distributed with this source or visit
12
 * http://opensource.org/licenses/MIT
13
 */
14
15
16
namespace Pinepain\JsSandbox\ObjectValue;
17
18
19
use V8\Context;
20
use V8\ObjectValue;
21
22
23
class ObjectValueHydrator implements ObjectValueHydratorInterface
24
{
25
    /**
26
     * @var ObjectValueHydratorInterface[]
27
     */
28
    private $hydrators;
29
30
    /**
31
     * @param ObjectValueHydratorInterface[] ...$hydrators
32
     */
33
    public function __construct(ObjectValueHydratorInterface ...$hydrators)
34
    {
35
        $this->hydrators = $hydrators;
0 ignored issues
show
Documentation Bug introduced by
It seems like $hydrators of type array<integer,array<inte...lueHydratorInterface>>> is incompatible with the declared type array<integer,object<Pin...alueHydratorInterface>> of property $hydrators.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
    }
37
38
    public function hydrateObjectValue(Context $context, ObjectValue $object)
39
    {
40
        foreach ($this->hydrators as $hydrator) {
41
            $hydrator->hydrateObjectValue($context, $object);
42
        }
43
    }
44
}
45