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 ( 86b5f6...b6d48e )
by Romain
01:45
created

Embeddable::getRouteName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Halapi\Annotation;
4
5
/**
6
 * Tell the serializer if a property embeddable in a representation.
7
 *
8
 * @Annotation
9
 * @Target("PROPERTY")
10
 */
11
class Embeddable
12
{
13
    /**
14
     * @var string
15
     */
16
    private $routeName;
17
18
    /**
19
     * Constructor.
20
     *
21
     * @param array $data An array of key/value parameters
22
     *
23
     * @throws \BadMethodCallException
24
     */
25
    public function __construct(array $data)
26
    {
27
        if (isset($data['value'])) {
28
            $data['routeName'] = $data['value'];
29
            unset($data['value']);
30
        }
31
32
        foreach ($data as $key => $value) {
33
            $method = 'set'.str_replace('_', '', $key);
34
            if (!method_exists($this, $method)) {
35
                throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this)));
36
            }
37
            $this->$method($value);
38
        }
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getRouteName()
45
    {
46
        return $this->routeName;
47
    }
48
49
    /**
50
     * @param string $routeName
51
     */
52
    public function setRouteName($routeName)
53
    {
54
        $this->routeName = $routeName;
55
    }
56
}
57