Test Failed
Push — drivers ( 446647...4bb5a4 )
by Joe
09:29
created

EventCacheContainer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Support\Events;
4
5
use PhpWinTools\WmiScripting\Containers\Container;
6
7
class EventCacheContainer extends Container
8
{
9
    protected $fired_event_key = 'actual';
10
11
    protected $event_ancestor_key = 'ancestors';
12
13
    protected $event_listeners_key = 'listeners';
14
15
    /** TODO: Implement PSR Cache for this */
16
    public function __construct()
17
    {
18
        $this->set($this->fired_event_key);
19
        $this->set($this->event_ancestor_key);
20
        $this->set($this->event_listeners_key);
21
    }
22
23
    public function addActual(string $event_name, int $index)
24
    {
25
        $this->append("{$this->fired_event_key}.{$event_name}", $index);
26
27
        return $this;
28
    }
29
}
30