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 — dev ( 4d6522...cafe43 )
by Андрей
03:51
created

ModuleOptions   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 6
c 3
b 0
f 0
lcom 1
cbo 1
dl 0
loc 72
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRootEntityNamespace() 0 4 1
A setRootEntityNamespace() 0 6 1
A getEntityMap() 0 4 1
A setEntityMap() 0 6 1
A getEntityClassName() 0 8 2
1
<?php
2
/**
3
 * @link  https://github.com/old-town/workflow-zf2-toolkit
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Toolkit\Options;
7
8
use Zend\Stdlib\AbstractOptions;
9
10
/**
11
 * Class ModuleOptions
12
 *
13
 * @package OldTown\Workflow\ZF2\Toolkit\Options
14
 */
15
class ModuleOptions extends AbstractOptions
16
{
17
    /**
18
     * Наймспейс для сущностей.
19
     *
20
     * @var string
21
     */
22
    protected $rootEntityNamespace;
23
24
    /**
25
     * Карта доступа к сущностям
26
     *
27
     * @var array
28
     */
29
    protected $entityMap = [];
30
31
    /**
32
     * @return string
33
     */
34
    public function getRootEntityNamespace()
35
    {
36
        return $this->rootEntityNamespace;
37
    }
38
39
    /**
40
     * @param string $rootEntityNamespace
41
     *
42
     * @return $this
43
     */
44
    public function setRootEntityNamespace($rootEntityNamespace)
45
    {
46
        $this->rootEntityNamespace = $rootEntityNamespace;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public function getEntityMap()
55
    {
56
        return $this->entityMap;
57
    }
58
59
    /**
60
     * @param array $entityMap
61
     *
62
     * @return $this
63
     */
64
    public function setEntityMap(array $entityMap = [])
65
    {
66
        $this->entityMap = $entityMap;
67
68
        return $this;
69
    }
70
71
    /**
72
     * Возвращает класс сущности по ее имени
73
     *
74
     * @param string $entity
75
     *
76
     * @return array|string
77
     */
78
    public function getEntityClassName($entity)
79
    {
80
        if (array_key_exists($entity, $this->entityMap)) {
81
            return $this->entityMap;
82
        }
83
84
        return $this->rootEntityNamespace . $entity;
85
    }
86
}
87