Passed
Push — master ( 78cea0...e6e26f )
by Joe
02:51
created

ApiObjectCallStack::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Testing\CallStacks;
4
5
class ApiObjectCallStack
6
{
7
    protected static $instance;
8
9
    protected $stack;
10
11 1
    public function __construct()
12
    {
13 1
        static::$instance = $this;
14 1
    }
15
16 2
    public static function newInstance()
17
    {
18 2
        return static::$instance = new static();
19
    }
20
21 2
    public static function instance()
22
    {
23 2
        return static::$instance ?? new static();
24
    }
25 2
26
    public function add(ApiObjectCall $call)
27
    {
28
        $this->stack[] = $call;
29
30
        return $this;
31
    }
32
}
33