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 — static-map ( 1bc0cf )
by Eric
64:02
created

StaticOptionsAwareTrait   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 79
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A hasStaticOptions() 0 4 1
A getStaticOptions() 0 4 1
A setStaticOptions() 0 5 1
A addStaticOptions() 0 6 2
A hasStaticOption() 0 4 1
A getStaticOption() 0 4 2
A setStaticOption() 0 4 1
A removeStaticOption() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Utility;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
trait StaticOptionsAwareTrait
18
{
19
    /**
20
     * @var mixed[]
21
     */
22
    private $staticOptions = [];
23
24
    /**
25
     * @return bool
26
     */
27
    public function hasStaticOptions()
28
    {
29
        return !empty($this->staticOptions);
30
    }
31
32
    /**
33
     * @return mixed[]
34
     */
35
    public function getStaticOptions()
36
    {
37
        return $this->staticOptions;
38
    }
39
40
    /**
41
     * @param mixed[] $options
42
     */
43
    public function setStaticOptions(array $options)
44
    {
45
        $this->staticOptions = [];
46
        $this->addStaticOptions($options);
47
    }
48
49
    /**
50
     * @param mixed[] $options
51
     */
52
    public function addStaticOptions(array $options)
53
    {
54
        foreach ($options as $option => $value) {
55
            $this->setStaticOption($option, $value);
56
        }
57
    }
58
59
    /**
60
     * @param string $option
61
     *
62
     * @return bool
63
     */
64
    public function hasStaticOption($option)
65
    {
66
        return isset($this->staticOptions[$option]);
67
    }
68
69
    /**
70
     * @param string $option
71
     *
72
     * @return mixed
73
     */
74
    public function getStaticOption($option)
75
    {
76
        return $this->hasStaticOption($option) ? $this->staticOptions[$option] : null;
77
    }
78
79
    /**
80
     * @param string $option
81
     * @param mixed  $value
82
     */
83
    public function setStaticOption($option, $value)
84
    {
85
        $this->staticOptions[$option] = $value;
86
    }
87
88
    /**
89
     * @param string $option
90
     */
91
    public function removeStaticOption($option)
92
    {
93
        unset($this->staticOptions[$option]);
94
    }
95
}
96