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 — 3.0 ( 043bf5...92a966 )
by Vermeulen
02:10
created

Options::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace BFW;
4
5
use \Exception;
6
7
/**
8
 * Class to manage Options
9
 */
10
class Options
11
{
12
    /**
13
     * @var array $option option's list
14
     */
15
    protected $options = [];
16
17
    /**
18
     * Constructor
19
     * Merge default option with passed values
20
     * 
21
     * @param array $defaultOptions Default options
22
     * @param array $options Options from applications/users
23
     */
24
    public function __construct($defaultOptions, $options)
25
    {
26
        $this->options = array_merge($defaultOptions, $options);
27
    }
28
    
29
    /**
30
     * Getter accessor to options property
31
     * 
32
     * @return array
33
     */
34
    public function getOptions()
35
    {
36
        return $this->options;
37
    }
38
39
    /**
40
     * Get the value for an option
41
     * 
42
     * @param string $optionKey The option key
43
     * 
44
     * @return mixed
45
     * 
46
     * @throws Exception If the key not exists
47
     */
48
    public function getValue($optionKey)
49
    {
50
        if (!isset($this->options[$optionKey])) {
51
            throw new Exception('Option key '.$optionKey.' not exist.');
52
        }
53
54
        return $this->options[$optionKey];
55
    }
56
}
57