Test Failed
Pull Request — master (#147)
by Simone
01:55
created

Configurator   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 41
ccs 0
cts 15
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A __call() 0 6 1
A resourceName() 0 4 1
A container() 0 4 1
A rewrites() 0 4 1
A globals() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of sensorario/resources repository
5
 *
6
 * (c) Simone Gentili <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sensorario\Resources;
13
14
/**
15
 * @method array allowed() provide resource's allowed parameters
16
 * @method array allowedValues() provide resource's allowed values parameters
17
 * @method array mandatory() provide resource's mandatory parameters
18
 * @method array defaults() provide resource's default parameters
19
 * @method array rules() provide resource's rules
20
 * @method array ranges() provide range of available values for a property
21
 */
22
final class Configurator
23
{
24
    private $container;
25
26
    private $resourceName;
27
28
    public function __construct(
29
        $resourceName,
30
        Container $container
31
    ) {
32
        $this->resourceName = $resourceName;
33
        $this->container = $container;
34
    }
35
36
    public function __call($method, $bar)
37
    {
38
        return $this->container->$method(
39
            $this->resourceName
40
        );
41
    }
42
43
    public function resourceName()
44
    {
45
        return $this->resourceName;
46
    }
47
48
    public function container()
49
    {
50
        return $this->container;
51
    }
52
53
    public function rewrites()
54
    {
55
        return $this->container->rewrites();
56
    }
57
58
    public function globals()
59
    {
60
        return $this->container->globals();
61
    }
62
}
63