Service   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 4
A getAliases() 0 3 1
A allowArray() 0 3 1
A getAliasName() 0 3 1
1
<?php
2
3
namespace Devmachine\Bundle\ServicesInjectorBundle\Configuration;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
6
7
/**
8
 * @Annotation
9
 */
10
class Service implements ConfigurationInterface
11
{
12
    private $aliases = [];
13
14
    public function __construct(array $data)
15
    {
16
        if (isset($data['value'])) {
17
            $data = (array) $data['value'];
18
        }
19
20
        foreach ($data as $key => $value) {
21
            $this->aliases[is_numeric($key) ? $value : $key] = $value;
22
        }
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function getAliases()
29
    {
30
        return $this->aliases;
31
    }
32
33
    public function getAliasName()
34
    {
35
        return 'services';
36
    }
37
38
    public function allowArray()
39
    {
40
        return true;
41
    }
42
}
43