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 ( 643d67...78595b )
by Sergey
02:43
created

ClassMetadata::mergeMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/*
3
 * This file is part of the reva2/jsonapi.
4
 *
5
 * (c) OrbitScripts LLC <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
12
namespace Reva2\JsonApi\Decoders\Mapping;
13
14
use Reva2\JsonApi\Contracts\Decoders\Mapping\ClassMetadataInterface;
15
16
/**
17
 * Generic class metadata
18
 *
19
 * @package Reva2\JsonApi\Decoders\Mapping
20
 * @author Sergey Revenko <[email protected]>
21
 */
22
class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
23
{
24
    /***
25
     * @var string|null
26
     * @internal
27
     */
28
    public $discField;
29
30
    /**
31
     * @var array
32
     * @internal
33
     */
34
    public $discMap;
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function getDiscriminatorField()
40
    {
41
        return $this->discField;
42
    }
43
44
    /**
45
     * Sets discriminator field
46
     *
47
     * @param string|null $field
48
     * @return $this
49
     */
50
    public function setDiscriminatorField($field = null)
51
    {
52
        $this->discField = $field;
53
54
        return $this;
55
    }
56
57
    /**
58
     * Sets discriminator map
59
     *
60
     * @param array $map
61
     * @return $this
62
     */
63
    public function setDiscriminatorMap(array $map)
64
    {
65
        $this->discMap = $map;
66
67
        return $this;
68
    }
69
70
    /**
71
     * @inheritdoc
72
     */
73
    public function getDiscriminatorClass($value)
74
    {
75
        if (!array_key_exists($value, $this->discMap)) {
76
            throw new \InvalidArgumentException(sprintf(
77
                "Discriminator class for value '%s' not specified",
78
                $value
79
            ));
80
        }
81
82
        return $this->discMap[$value];
83
    }
84
85
    /**
86
     * @inheritdoc
87
     */
88
    public function mergeMetadata($metadata)
89
    {
90
        throw new \RuntimeException('Not implemented');
91
    }
92
}