Passed
Push — master ( d2ebdc...958928 )
by Bogdan
05:05
created

WrappedObject   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 51
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getValue() 0 4 1
A getObject() 0 4 1
A getSpec() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/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\Wrappers\ObjectComponents;
17
18
19
use Pinepain\JsSandbox\Specs\ObjectSpecInterface;
20
use V8\ObjectValue;
21
22
23
class WrappedObject
24
{
25
    /**
26
     * @var ObjectValue
27
     */
28
    private $value;
29
    /**
30
     * @var object
31
     */
32
    private $object;
33
    /**
34
     * @var null|ObjectSpecInterface
35
     */
36
    private $spec;
37
38
    /**
39
     * @param ObjectValue              $value
40
     * @param                          $object
41
     * @param null|ObjectSpecInterface $spec
42
     */
43
    public function __construct(ObjectValue $value, $object, ?ObjectSpecInterface $spec = null)
44
    {
45
        $this->value  = $value;
46
        $this->object = $object;
47
        $this->spec   = $spec;
48
    }
49
50
    /**
51
     * @return ObjectValue
52
     */
53
    public function getValue(): ObjectValue
54
    {
55
        return $this->value;
56
    }
57
58
    /**
59
     * @return object
60
     */
61
    public function getObject()
62
    {
63
        return $this->object;
64
    }
65
66
    /**
67
     * @return null|ObjectSpecInterface
68
     */
69
    public function getSpec(): ?ObjectSpecInterface
70
    {
71
        return $this->spec;
72
    }
73
}
74