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.

Config::getHeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace NMeta;
4
5
/**
6
 * Class Config
7
 *
8
 * @package NMeta
9
 * @author  Casper Rasmussen <[email protected]>
10
 */
11
class Config
12
{
13
    /** @var string */
14
    protected $header;
15
16
    /** @var array */
17
    protected $platforms;
18
19
    /** @var array */
20
    protected $environments;
21
22
    public function __construct(array $data)
23
    {
24
        $this->header = (string)$data['header'];
25
        $this->platforms = (array)$data['platforms'];
26
        $this->environments = (array)$data['environments'];
27
    }
28
29
    /**
30
     * @return string
31
     * @author Casper Rasmussen <[email protected]>
32
     */
33
    public function getHeader(): string
34
    {
35
        return $this->header;
36
    }
37
38
    /**
39
     * @return array
40
     * @author Casper Rasmussen <[email protected]>
41
     */
42
    public function getPlatforms(): array
43
    {
44
        return $this->platforms;
45
    }
46
47
    /**
48
     * @return array
49
     * @author Casper Rasmussen <[email protected]>
50
     */
51
    public function getEnvironments(): array
52
    {
53
        return $this->environments;
54
    }
55
56
    /**
57
     * toArray
58
     *
59
     * @return array
60
     * @author Casper Rasmussen <[email protected]>
61
     */
62
    public function toArray(): array
63
    {
64
        return [
65
            'header'       => $this->header,
66
            'platforms'    => $this->platforms,
67
            'environments' => $this->environments,
68
        ];
69
    }
70
71
    /**
72
     * createDefault
73
     *
74
     * @return \NMeta\Config
75
     * @author Casper Rasmussen <[email protected]>
76
     */
77
    public static function createDefault(): self
78
    {
79
        return new self([
80
            'header'       => 'Client-Meta-Information',
81
            'platforms'    => [
82
                'android',
83
                'ios',
84
                'web',
85
            ],
86
            'environments' => [
87
                'local',
88
                'development',
89
                'staging',
90
                'production',
91
            ],
92
        ]);
93
    }
94
}