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 ( ecf461...e116b7 )
by Vadim
15:02
created

AnnotationBuilderConfigFactory::createService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 10
loc 10
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace Newage\Annotations\Factory;
4
5
use Newage\Annotations\Config\AnnotationBuilderConfig;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9 View Code Duplication
class AnnotationBuilderConfigFactory implements FactoryInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    public function createService(ServiceLocatorInterface $serviceLocator)
12
    {
13
        $config = $serviceLocator->get('config');
14
        if (!isset($config['annotations']['AnnotationBuilder'])) {
15
            throw new \Exception('Configuration does not have options "AnnotationBuilder"');
16
        }
17
18
        $annotationConfig = new AnnotationBuilderConfig($config['annotations']['AnnotationBuilder']);
19
        return $annotationConfig;
20
    }
21
}
22