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 ( 0c3dc8...b46d2a )
by Hong
03:03
created

StaticManagerTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 18 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\Message\Message;
18
use Phossa2\Event\Exception\BadMethodCallException;
19
20
/**
21
 * StaticManagerTrait
22
 *
23
 * Able to use event manager statically by adding special scope '__STATIC__'
24
 *
25
 * @package Phossa2\Event
26
 * @author  Hong Zhang <[email protected]>
27
 * @version 2.0.0
28
 * @since   2.0.0 added
29
 */
30
trait StaticManagerTrait
31
{
32
    /**
33
     * Provides a static interface for event dispatcher's dynamic methods
34
     *
35
     * @param  string $name method name
36
     * @param  array $arguments arguments
37
     * @return mixed
38
     * @access public
39
     * @static
40
     * @internal
41
     */
42
    public static function __callStatic($name, array $arguments)
43
    {
44
        // get a shared event manager in scope __STATIC__
45
        $mgr = static::getShareable('__STATIC__');
46
47
        if (method_exists($mgr, $name)) {
48
            return call_user_func_array([$mgr, $name], $arguments);
49
        }
50
51
        throw new BadMethodCallException(
52
            Message::get(
53
                Message::MSG_METHOD_NOTFOUND,
54
                $name,
55
                get_called_class()
56
            ),
57
            Message::MSG_METHOD_NOTFOUND
58
        );
59
    }
60
}
61