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.

Configuration   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 9
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 65
ccs 18
cts 18
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A applyDefaults() 0 8 3
A setPair() 0 4 1
A getPair() 0 4 1
A hasPair() 0 4 1
A getPairs() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of PhuninNode.
6
 *
7
 ** (c) 2013 - 2016 Cees-Jan Kiewiet
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace WyriHaximus\PhuninNode;
14
15
/**
16
 * Class Configuration
17
 * @package WyriHaximus\PhuninNode
18
 */
19
class Configuration
20
{
21
    /**
22
     * Configuration constructor.
23
     * @param array $options
24
     */
25 48
    public function __construct(array $options = [])
26
    {
27 48
        foreach ($options as $key => $value) {
28 1
            $this->setPair($key, $value);
29
        }
30 48
    }
31
32
    /**
33
     * @param array $defaults
34
     */
35 46
    public function applyDefaults(array $defaults)
36
    {
37 46
        foreach ($defaults as $key => $value) {
38 46
            if (!$this->hasPair($key)) {
39 46
                $this->setPair($key, $value);
40
            }
41
        }
42 46
    }
43
44
    /**
45
     * @var array
46
     */
47
    protected $pairs = [];
48
49
    /**
50
     * @param string $key
51
     * @param $value
52
     */
53 48
    public function setPair(string $key, $value)
54
    {
55 48
        $this->pairs[$key] = new Value($key, $value);
56 48
    }
57
58
    /**
59
     * @param string $key
60
     * @return Value
61
     */
62 6
    public function getPair(string $key): Value
63
    {
64 6
        return $this->pairs[$key];
65
    }
66
67
    /**
68
     * @param string $key
69
     * @return bool
70
     */
71 46
    public function hasPair($key): bool
72
    {
73 46
        return isset($this->pairs[$key]);
74
    }
75
76
    /**
77
     * @return array
78
     */
79 3
    public function getPairs(): array
80
    {
81 3
        return $this->pairs;
82
    }
83
}
84