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.

ModuleOptions   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 127
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 5

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 10
c 6
b 0
f 0
lcom 2
cbo 5
dl 0
loc 127
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getManagers() 0 4 1
A setManagers() 0 6 1
A getConfigurations() 0 4 1
A setConfigurations() 0 6 1
A getManagerAliases() 0 4 1
A setManagerAliases() 0 6 1
A getManagerOptions() 0 9 2
A getConfigurationOptions() 0 9 2
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Options;
7
8
use Zend\Stdlib\AbstractOptions;
9
10
/**
11
 * Class ModuleOptions
12
 *
13
 * @package OldTown\Workflow\ZF2\Options
14
 */
15
class ModuleOptions extends AbstractOptions
16
{
17
    /**
18
     * Менеджеры workflow
19
     *
20
     * @var  array
21
     */
22
    protected $managers;
23
24
    /**
25
     * Конфигурации для менеджеров
26
     *
27
     * @var array
28
     */
29
    protected $configurations;
30
31
    /**
32
     * Псевдонимы для имен менеджеров wf
33
     *
34
     * @var array
35
     */
36
    protected $managerAliases = [];
37
38
    /**
39
     * @return array
40
     */
41
    public function getManagers()
42
    {
43
        return $this->managers;
44
    }
45
46
    /**
47
     * @param array $managers
48
     *
49
     * @return $this
50
     */
51
    public function setManagers(array $managers)
52
    {
53
        $this->managers = $managers;
54
55
        return $this;
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    public function getConfigurations()
62
    {
63
        return $this->configurations;
64
    }
65
66
    /**
67
     * @param array $configurations
68
     *
69
     * @return $this
70
     */
71
    public function setConfigurations(array $configurations)
72
    {
73
        $this->configurations = $configurations;
74
75
        return $this;
76
    }
77
78
    /**
79
     * Псевдонимы для имен менеджеров wf
80
     *
81
     * @return array
82
     */
83
    public function getManagerAliases()
84
    {
85
        return $this->managerAliases;
86
    }
87
88
    /**
89
     * Устанавливает псевдонимы для имен менеджеров wf
90
     *
91
     * @param array $managerAliases
92
     *
93
     * @return $this
94
     */
95
    public function setManagerAliases(array $managerAliases = [])
96
    {
97
        $this->managerAliases = $managerAliases;
98
99
        return $this;
100
    }
101
102
103
    /**
104
     * Возвращает настройки менеджера по его имени
105
     *
106
     * @param string $managerName
107
     *
108
     * @return ManagerOptions
109
     *
110
     * @throws Exception\InvalidManagerNameException
111
     */
112
    public function getManagerOptions($managerName)
113
    {
114
        if (!array_key_exists($managerName, $this->managers)) {
115
            $errMsg = sprintf('Invalid manager name %s', $managerName);
116
            throw new Exception\InvalidManagerNameException($errMsg);
117
        }
118
119
        return new ManagerOptions($this->managers[$managerName]);
120
    }
121
122
123
    /**
124
     * Возвращает настройки с заданным именем
125
     *
126
     * @param string $configurationName
127
     *
128
     * @return ConfigurationOptions
129
     *
130
     * @throws Exception\InvalidConfigurationNameException
131
     */
132
    public function getConfigurationOptions($configurationName)
133
    {
134
        if (!array_key_exists($configurationName, $this->configurations)) {
135
            $errMsg = sprintf('Invalid configuration name %s', $configurationName);
136
            throw new Exception\InvalidConfigurationNameException($errMsg);
137
        }
138
139
        return new ConfigurationOptions($this->configurations[$configurationName]);
140
    }
141
}
142