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 ( 85253d...448e10 )
by William
12:27
created

SymfonyContainerResolver::getRelationProvider()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
1
<?php
2
3
namespace Hateoas\Configuration\Provider\Resolver;
4
5
use Hateoas\Configuration\RelationProvider as RelationProviderConfiguration;
6
use Symfony\Component\DependencyInjection\ContainerInterface;
7
8
/**
9
 * @author Adrien Brault <[email protected]>
10
 */
11
class SymfonyContainerResolver implements RelationProviderResolverInterface
12
{
13
    /**
14
     * @var ContainerInterface
15
     */
16
    private $container;
17
18
    public function __construct(ContainerInterface $container)
19
    {
20
        $this->container = $container;
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 View Code Duplication
    public function getRelationProvider(RelationProviderConfiguration $configuration, $object)
0 ignored issues
show
Duplication introduced by
This method 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...
27
    {
28
        if (!preg_match('/^(?P<service>[a-z0-9_.]+):(?P<method>[a-z0-9_]+)$/i', $configuration->getName(), $matches)) {
29
            return null;
30
        }
31
32
        return array(
33
            $this->container->get($matches['service']),
34
            $matches['method']
35
        );
36
    }
37
}
38