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.

RelationPropertyMetadata::__construct()   B
last analyzed

Complexity

Conditions 5
Paths 8

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
rs 8.5906
cc 5
eloc 15
nc 8
nop 2
1
<?php
2
3
namespace Hateoas\Serializer\Metadata;
4
5
use Hateoas\Configuration\Exclusion;
6
use Hateoas\Configuration\Relation;
7
use JMS\Serializer\Metadata\VirtualPropertyMetadata;
8
use JMS\Serializer\TypeParser;
9
10
/**
11
 * @author Adrien Brault <[email protected]>
12
 */
13
class RelationPropertyMetadata extends VirtualPropertyMetadata
14
{
15
    public function __construct(Exclusion $exclusion = null, Relation $relation = null)
16
    {
17
        if (null !== $relation) {
18
            $this->name = $relation->getName();
19
            $this->class = get_class($relation);
20
21
            $typeParser = new TypeParser();
22
            if (null !== $relation->getEmbedded()) {
23
                $this->type = $typeParser->parse('Hateoas\Model\Embedded');
24
            } elseif (null !== $relation->getHref()) {
25
                $this->type = $typeParser->parse('Hateoas\Model\Link');
26
            }
27
        }
28
29
        if (null === $exclusion) {
30
            return;
31
        }
32
33
        $this->groups = $exclusion->getGroups();
34
        $this->sinceVersion = $exclusion->getSinceVersion();
35
        $this->untilVersion = $exclusion->getUntilVersion();
36
        $this->maxDepth = $exclusion->getMaxDepth();
37
    }
38
}
39