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

Configurator::rewrites()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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