Completed
Push — refonte ( 994918...f7c861 )
by Arnaud
02:21
created

AdminResource   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 54
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getConfiguration() 0 4 1
A getEntityClass() 0 4 1
1
<?php
2
3
namespace LAG\AdminBundle\Resource;
4
5
class AdminResource
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $name;
11
12
    /**
13
     * @var array
14
     */
15
    protected $configuration;
16
17
    /**
18
     * @var string
19
     */
20
    protected $entityClass;
21
22
    /**
23
     * Resource constructor.
24
     *
25
     * @param string $name
26
     * @param array  $configuration
27
     */
28
    public function __construct(string $name, array $configuration)
29
    {
30
        $this->name = $name;
31
        $this->configuration = $configuration;
32
        $this->entityClass = $configuration['entity'];
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getName(): string
39
    {
40
        return $this->name;
41
    }
42
43
    /**
44
     * @return array
45
     */
46
    public function getConfiguration(): array
47
    {
48
        return $this->configuration;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getEntityClass() : string
55
    {
56
        return $this->entityClass;
57
    }
58
}
59