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 ( 91f41a...3eef33 )
by Hong
02:53
created

EventableExtensionAwareTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addExt() 0 12 3
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\Shared\Extension\ExtensionInterface;
18
use Phossa2\Shared\Extension\ExtensionAwareTrait;
19
use Phossa2\Event\Interfaces\EventableExtensionAwareInterface;
20
21
/**
22
 * EventableExtensionAwareTrait
23
 *
24
 * @package Phossa2\Event
25
 * @author  Hong Zhang <[email protected]>
26
 * @see     EventableExtensionAwareInterface
27
 * @version 2.1.6
28
 * @since   2.1.6 added
29
 */
30
trait EventableExtensionAwareTrait
31
{
32
    use ExtensionAwareTrait, ListenerTrait;
33
34
    /**
35
     * {@inheritDoc}
36
     */
37
    public function addExt(
38
        $extension,
39
        /*# string */ $eventName = '*',
40
        /*# int */ $priority = 0
41
    ) {
42
        if (is_object($extension) && $extension instanceof ExtensionInterface) {
43
            $this->addExtension($extension);
44
        } else {
45
            $this->registerEvent($eventName, [$extension, $priority]);
46
        }
47
        return $this;
48
    }
49
}
50