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.

MetadataReaderManager::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2-service
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Service\Metadata;
7
8
use OldTown\Workflow\ZF2\Service\Metadata\Reader\ReaderInterface;
9
use Zend\ServiceManager\AbstractPluginManager;
10
use Zend\ServiceManager\ConfigInterface;
11
use OldTown\Workflow\ZF2\Service\Metadata\Reader\AnnotationReader;
12
13
/**
14
 * Class MetadataReaderManager
15
 *
16
 * @package OldTown\Workflow\ZF2\Service\Metadata
17
 */
18
class MetadataReaderManager extends AbstractPluginManager implements MetadataReaderManagerInterface
19
{
20
    /**
21
     * @param ConfigInterface|null $configuration
22
     */
23
    public function __construct(ConfigInterface $configuration = null)
24
    {
25
        $this->init();
26
        parent::__construct($configuration);
27
    }
28
29
    /**
30
     * Инициализация
31
     *
32
     * @return void
33
     */
34
    protected function init()
35
    {
36
        $this->invokableClasses = [
37
            'annotation' => AnnotationReader::class
38
        ];
39
    }
40
41
    /**
42
     * @param mixed $plugin
43
     *
44
     * @throws Exception\InvalidMetadataReaderException
45
     */
46
    public function validatePlugin($plugin)
47
    {
48
        if (!$plugin instanceof ReaderInterface) {
49
            $errMsg = sprintf('MetadataReader not implement %s', ReaderInterface::class);
50
            throw new Exception\InvalidMetadataReaderException($errMsg);
51
        }
52
    }
53
}
54