GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

EventEmitter::onAny()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace CapMousse\ReactRestify\Evenement;
4
5
class EventEmitter extends \Evenement\EventEmitter
6
{
7
    /**
8
     * @var array
9
     */
10
    protected $anyListeners = [];
11
12
    /**
13
     * Listen all event
14
     *
15
     * @param Callable $listener
16
     *
17
     * @return void
18
     */
19
    public function onAny(callable $listener)
20
    {
21
        $this->anyListeners[] = $listener;
22
    }
23
24
    /**
25
     * Disable a onAny listener
26
     *
27
     * @param Callable $listener
28
     *
29
     * @return Void
30
     */
31
    public function offAny(callable $listener)
32
    {
33
        if (false !== $index = array_search($listener, $this->anyListeners, true)) {
34
            unset($this->anyListeners[$index]);
35
        }
36
    }
37
38
    /**
39
     * Emit an event
40
     *
41
     * @param string $event
42
     * @param array  $arguments
43
     *
44
     * @return Void
45
     */
46
    public function emit($event, array $arguments = [])
47
    {
48
        foreach ($this->anyListeners as $listener) {
49
            call_user_func_array($listener, [$event , $arguments]);
50
        }
51
52
        parent::emit($event, $arguments);
53
    }
54
}
55