OptionProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get() 0 9 1
1
<?php
2
/**
3
 * This file is part of the Madapaja.TwigModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace Madapaja\TwigModule;
8
9
use BEAR\AppMeta\AbstractAppMeta;
10
use Ray\Di\Di\Named;
11
use Ray\Di\ProviderInterface;
12
13
class OptionProvider implements ProviderInterface
14
{
15
    /**
16
     * @var AbstractAppMeta
17
     */
18
    private $appMeta;
19
20
    /**
21
     * @var bool
22
     */
23
    private $isDebug;
24
25
    /**
26
     * @Named("isDebug=Madapaja\TwigModule\Annotation\TwigDebug")
27
     * @SuppressWarnings(PHPMD.BooleanArgumentFlag)
28
     */
29 2
    public function __construct(AbstractAppMeta $appMeta, $isDebug = false)
30
    {
31 2
        $this->appMeta = $appMeta;
32 2
        $this->isDebug = $isDebug;
33 2
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 2
    public function get()
39
    {
40
        $options = [
41 2
            'debug' => $this->isDebug,
42 2
            'cache' => $this->appMeta->tmpDir
43
        ];
44
45 2
        return $options;
46
    }
47
}
48