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 ( 1978d2...e2f699 )
by William
03:55
created

RelationsRepository::getRelations()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 12
rs 9.4286
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace Hateoas\Configuration;
4
5
use Hateoas\Configuration\Provider\RelationProviderInterface as RelationProviderProviderInterface;
6
use Metadata\MetadataFactoryInterface;
7
8
/**
9
 * @author Adrien Brault <[email protected]>
10
 */
11
class RelationsRepository
12
{
13
    /**
14
     * @var MetadataFactoryInterface
15
     */
16
    private $metadataFactory;
17
18
    /**
19
     * @var RelationProviderProvider
20
     */
21
    private $relationProvider;
22
23
    /**
24
     * @param MetadataFactoryInterface          $metadataFactory
25
     * @param RelationProviderProviderInterface $relationProvider
26
     */
27
    public function __construct(MetadataFactoryInterface $metadataFactory, RelationProviderProviderInterface $relationProvider)
28
    {
29
        $this->metadataFactory  = $metadataFactory;
30
        $this->relationProvider = $relationProvider;
0 ignored issues
show
Documentation Bug introduced by
It seems like $relationProvider of type object<Hateoas\Configura...ationProviderInterface> is incompatible with the declared type object<Hateoas\Configura...lationProviderProvider> of property $relationProvider.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31
    }
32
33
    /**
34
     * @param object $object
35
     *
36
     * @return Relation[]
37
     */
38
    public function getRelations($object)
39
    {
40
        $relations = array();
41
42
        if (null !== $classMetadata = $this->metadataFactory->getMetadataForClass(get_class($object))) {
43
            $relations = array_merge($relations, $classMetadata->getRelations());
44
        }
45
46
        $relations = array_merge($relations, $this->relationProvider->getRelations($object));
47
48
        return $relations;
49
    }
50
}
51