Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 0 |
1 | <?php |
||
12 | class SWbemProperty extends AbstractWbemObject implements Property |
||
13 | { |
||
14 | protected $name; |
||
15 | |||
16 | protected $value; |
||
17 | |||
18 | protected $origin; |
||
19 | |||
20 | /** @var VariantWrapper|PropertyVariant */ |
||
21 | protected $object; |
||
22 | |||
23 | 2 | public function __construct(VariantWrapper $variant) |
|
24 | { |
||
25 | 2 | parent::__construct($variant); |
|
26 | |||
27 | 2 | $this->name = (string) $this->object->Name; |
|
|
|||
28 | 2 | $this->origin = (string) $this->object->Origin; |
|
29 | 2 | $this->value = $this->detectValue($this->object->Value); |
|
30 | 2 | } |
|
31 | |||
32 | 2 | public function toArray(): array |
|
33 | { |
||
34 | return [ |
||
35 | 2 | 'value' => $this->value, |
|
36 | 2 | 'origin' => $this->origin, |
|
37 | ]; |
||
38 | } |
||
39 | |||
40 | 2 | protected function detectValue($value) |
|
52 | } |
||
53 | } |
||
54 |