Completed
Push — master ( 1b508f...644e50 )
by Gabriel
08:31
created

Factory::dimensions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Sinergi\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 = 'sinergi';
12
    const PACKAGE_NAME = 'config';
13
14
    use ConfigurationTrait;
15
16
    /**
17
     * @param array|Configuration $config
18
     * @return Collection
19
     */
20
    public function __invoke($config)
21
    {
22
        if (is_array($config)) {
23
            $config = new Configuration($config);
24
        }
25
26
        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
        return [];
68
    }
69
}
70