SWbemObjectPath::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 15
ccs 13
cts 13
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Support\ApiObjects;
4
5
use PhpWinTools\Support\COM\VariantWrapper;
6
use PhpWinTools\WmiScripting\Support\ApiObjects\Contracts\ObjectPath;
7
use PhpWinTools\WmiScripting\Support\ApiObjects\VariantInterfaces\ObjectPathVariant;
8
9
/**
10
 * @link https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobjectpath
11
 */
12
class SWbemObjectPath extends AbstractWbemObject implements ObjectPath
13
{
14
    protected $authority;
15
16
    protected $class;
17
18
    protected $display_name;
19
20
    protected $is_class;
21
22
    protected $is_singleton;
23
24
    protected $keys;
25
26
    protected $namespace;
27
28
    protected $parent_namespace;
29
30
    protected $path;
31
32
    protected $relative_path;
33
34
    protected $server;
35
36
    /** @var VariantWrapper|ObjectPathVariant */
37
    protected $object;
38
39 2
    public function __construct(VariantWrapper $variant)
40
    {
41 2
        parent::__construct($variant);
42
43 2
        $this->authority = $this->object->Authority;
0 ignored issues
show
Bug Best Practice introduced by
The property Authority does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
44 2
        $this->class = $this->object->Class;
0 ignored issues
show
Bug Best Practice introduced by
The property Class does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
45 2
        $this->display_name = $this->object->DisplayName;
0 ignored issues
show
Bug Best Practice introduced by
The property DisplayName does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
46 2
        $this->is_class = $this->object->IsClass;
0 ignored issues
show
Bug Best Practice introduced by
The property IsClass does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
47 2
        $this->is_singleton = $this->object->IsSingleton;
0 ignored issues
show
Bug Best Practice introduced by
The property IsSingleton does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
48 2
        $this->keys = [];
49 2
        $this->namespace = $this->object->Namespace;
0 ignored issues
show
Bug Best Practice introduced by
The property Namespace does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
50 2
        $this->parent_namespace = $this->object->ParentNamespace;
0 ignored issues
show
Bug Best Practice introduced by
The property ParentNamespace does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
51 2
        $this->path = $this->object->Path;
0 ignored issues
show
Bug Best Practice introduced by
The property Path does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
52 2
        $this->relative_path = $this->object->RelPath;
0 ignored issues
show
Bug Best Practice introduced by
The property RelPath does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
53 2
        $this->server = $this->object->Server;
0 ignored issues
show
Bug Best Practice introduced by
The property Server does not exist on PhpWinTools\Support\COM\VariantWrapper. Since you implemented __get, consider adding a @property annotation.
Loading history...
54 2
    }
55
}
56