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
Pull Request — master (#13)
by Jérémy
03:43 queued 01:52
created

ControllerContainer::resolveController()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace CapMousse\ReactRestify\Routing;
4
5
class ControllerContainer {
6
    private static $instances = [];
7
8
    public static function resolveController ($action)
9
    {
10
        $action = explode('@', $action);
11
12
        if (!isset(self::$instances[$action[0]])) {
13
            self::$instances[$action[0]] = new $action[0]();
14
        }
15
16
        return [self::$instances[$action[0]], $action[1]];
17
    }
18
}