ComCall   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Test Coverage

Coverage 70.83%

Importance

Changes 0
Metric Value
wmc 9
eloc 22
dl 0
loc 82
ccs 17
cts 24
cp 0.7083
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getApiCaller() 0 7 2
A getResponder() 0 3 1
A __construct() 0 8 1
A getArguments() 0 3 1
A getNextCaller() 0 3 1
A getCaller() 0 3 1
A getType() 0 3 1
A getMethod() 0 3 1
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Testing\CallStacks;
4
5
use PhpWinTools\WmiScripting\Support\ApiObjects\AbstractWbemObject;
6
7
class ComCall
8
{
9
    protected $type;
10
11
    protected $method;
12
13
    protected $arguments = [];
14
15
    protected $responder;
16
17
    protected $caller;
18
19
    protected $next_caller;
20
21 2
    public function __construct($type, $method, $arguments, $responder = null, $caller = null, $next_caller = null)
22
    {
23 2
        $this->type = $type;
24 2
        $this->method = $method;
25 2
        $this->arguments = $arguments;
26 2
        $this->responder = $responder;
27 2
        $this->caller = $caller;
28 2
        $this->next_caller = $next_caller;
29 2
    }
30
31
    /**
32
     * @return ComTraceSubject
33
     */
34 2
    public function getApiCaller()
35
    {
36 2
        if (array_key_exists(AbstractWbemObject::class, class_parents($this->getCaller()->getClass()))) {
37 2
            return $this->getCaller();
38
        }
39
40
        return $this->getNextCaller();
41
    }
42
43
    /**
44
     * @return mixed
45
     */
46
    public function getType()
47
    {
48
        return $this->type;
49
    }
50
51
    /**
52
     * @return mixed
53
     */
54 2
    public function getMethod()
55
    {
56 2
        return $this->method;
57
    }
58
59
    /**
60
     * @return array
61
     */
62 2
    public function getArguments(): array
63
    {
64 2
        return $this->arguments;
65
    }
66
67
    /**
68
     * @return ComTraceSubject
69
     */
70
    public function getResponder()
71
    {
72
        return $this->responder;
73
    }
74
75
    /**
76
     * @return ComTraceSubject
77
     */
78 2
    public function getCaller()
79
    {
80 2
        return $this->caller;
81
    }
82
83
    /**
84
     * @return ComTraceSubject
85
     */
86
    public function getNextCaller()
87
    {
88
        return $this->next_caller;
89
    }
90
}
91