Completed
Push — master ( 68fe25...8e1e8c )
by Woody
11s
created

Factory::mandatoryOptions()   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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Northwoods\Config;
4
5
use Interop\Config\ConfigurationTrait;
6
use Interop\Config\RequiresMandatoryOptions;
7
use Interop\Config\RequiresConfig;
8
9
class Factory implements RequiresMandatoryOptions, RequiresConfig
10
{
11
    const VENDOR_NAME = 'northwoods';
12
    const PACKAGE_NAME = 'config';
13
14
    use ConfigurationTrait;
15
16
    /**
17
     * @param array|Configuration $config
18
     * @return Collection
19
     */
20 20
    public function __invoke($config)
21
    {
22 20
        if (is_array($config)) {
23 20
            $config = new Configuration($config);
24
        }
25
26 20
        return new Collection($config);
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function vendorName()
33
    {
34
        return self::VENDOR_NAME;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function packageName()
41
    {
42
        return self::PACKAGE_NAME;
43
    }
44
45
    /**
46
     * @return string[] List with mandatory options
47
     */
48
    public function mandatoryOptions()
49
    {
50
        return [];
51
    }
52
53
    /**
54
     * @return string[] List with optional options
55
     */
56
    public function optionalOptions()
57
    {
58
        return [
59
            'path',
60
            'paths',
61
            'environment',
62
            'dotenv',
63
        ];
64
    }
65
66
    public function dimensions()
67
    {
68
        return [];
69
    }
70
}
71