Passed
Pull Request — master (#39)
by Daniel
03:37
created

ConfigFacade::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jellyfish\Config;
4
5
class ConfigFacade implements ConfigFacadeInterface
6
{
7
    /**
8
     * @var \Jellyfish\Config\ConfigFactory
9
     */
10
    protected $factory;
11
12
    /**
13
     * @param \Jellyfish\Config\ConfigFactory $factory
14
     */
15
    public function __construct(ConfigFactory $factory)
16
    {
17
        $this->factory = $factory;
18
    }
19
20
    /**
21
     * @param string $key
22
     * @param string|null $default
23
     *
24
     * @return string
25
     */
26
    public function get(string $key, ?string $default = null): string
27
    {
28
        return $this->factory->getConfig()->get($key, $default);
29
    }
30
}
31