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 ( 103a86...2f9008 )
by Bram
07:42 queued 05:18
created

IdGeneratorPluginManager::validate()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
ccs 0
cts 0
cp 0
rs 9.4285
cc 3
eloc 7
nc 2
nop 1
crap 12
1
<?php
2
/**
3
 * @author Bram Gerritsen [email protected]
4
 * @copyright (c) Bram Gerritsen 2013
5
 * @license http://opensource.org/licenses/mit-license.php
6
 */
7
8
namespace StrokerCache\IdGenerator;
9
10
use StrokerCache\Exception;
11
use Zend\ServiceManager\AbstractPluginManager;
12
use Zend\ServiceManager\Factory\InvokableFactory;
13
14
class IdGeneratorPluginManager extends AbstractPluginManager
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $instanceOf = IdGeneratorInterface::class;
20
21
    /**
22
     * @var array
23
     */
24
    protected $aliases = [
25
        'requesturi' => RequestUriGenerator::class,
26
        'requestUri' => RequestUriGenerator::class,
27
        'fulluri'   => FullUriGenerator::class,
28
        'fullUri'   => FullUriGenerator::class
29
    ];
30
31
    /**
32
     * Builtin generators
33
     *
34
     * @var array
35
     */
36
    protected $factories = [
37
        RequestUriGenerator::class => InvokableFactory::class,
38
        FullUriGenerator::class => InvokableFactory::class
39
    ];
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function validate($instance)
45
    {
46
        if ($instance instanceof $this->instanceOf) {
47
            // we're okay
48
            return;
49
        }
50
51
        throw new Exception\RuntimeException(sprintf(
52
            'Plugin of type %s is invalid; must implement %s\IdGeneratorInterface',
53
            (is_object($instance) ? get_class($instance) : gettype($instance)),
54
            __NAMESPACE__
55
        ));
56
    }
57
58
    /**
59
     * @deprecated to support ServiceManager v2
60
     */
61
    public function validatePlugin($instance)
62
    {
63
        $this->validate($instance);
64
    }
65
}
66