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.
Completed
Push — master ( ef225f...f42931 )
by Hong
04:41
created

ListenerTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A eventsListening() 0 4 1
A registerEvent() 0 9 2
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Event
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Event\Traits;
16
17
use Phossa2\Event\Interfaces\ListenerInterface;
18
19
/**
20
 * ListenerTrait
21
 *
22
 * @package Phossa2\Event
23
 * @author  Hong Zhang <[email protected]>
24
 * @see     ListenerInterface
25
 * @version 2.1.3
26
 * @since   2.1.3 added
27
 */
28
trait ListenerTrait
29
{
30
    /**
31
     * Events listening
32
     *
33
     * @var    array
34
     * @access protected
35
     */
36
    protected $events_listening = [];
37
38
    public function eventsListening()/*# : array */
39
    {
40
        return $this->events_listening;
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46
    public function registerEvent(/*# string */ $eventName, $handler)
47
    {
48
        if (!isset($this->events_listening[$eventName])) {
49
            $this->events_listening[$eventName] = [];
50
        }
51
        $this->events_listening[$eventName][] = $handler;
52
53
        return $this;
54
    }
55
}
56