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

EventCacheContainer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A addActual() 0 5 1
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