Completed
Pull Request — master (#56)
by Simone
02:30
created

Resource::applyConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 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
use RuntimeException;
15
16
class Resource
17
    extends MagicResource
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
Coding Style introduced by
Expected 0 spaces between "MagicResource" and comma; 1 found
Loading history...
18
    implements Interfaces\ResourceInterface
0 ignored issues
show
Coding Style introduced by
The implements keyword must be on the same line as the class name
Loading history...
19
{
20
    protected static $allowed = [];
21
22
    public static function mandatory()
23
    {
24
        return [];
25
    }
26
27
    public static function allowed()
28
    {
29
        return static::$allowed;
30
    }
31
32
    public static function allowedValues()
33
    {
34
        return [];
35
    }
36
37
    public static function rules()
38
    {
39
        return [];
40
    }
41
42
    public function applyConfiguration(
43
        $resourceName,
44
        Container $config
45
    ) {
46
        static::$allowed = $config->allowed($resourceName);
47
    }
48
}
49