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.

IdGeneratorPluginManager::validatePlugin()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
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