Configurator   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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 25
    public function __construct(
29
        $resourceName,
30
        Container $container
31
    ) {
32 25
        $this->resourceName = $resourceName;
33 25
        $this->container = $container;
34 25
    }
35
36 25
    public function __call($method, $bar)
37
    {
38 25
        return $this->container->$method(
39 25
            $this->resourceName
40
        );
41
    }
42
43 24
    public function resourceName()
44
    {
45 24
        return $this->resourceName;
46
    }
47
48 24
    public function container()
49
    {
50 24
        return $this->container;
51
    }
52
53 25
    public function rewrites()
54
    {
55 25
        return $this->container->rewrites();
56
    }
57
58 25
    public function globals()
59
    {
60 25
        return $this->container->globals();
61
    }
62
}
63