ConfigurableTestPluginConfiguration   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getAlreadyList() 0 3 1
A getList() 0 5 1
A getRoutingKeyConfig() 0 3 1
A getEnv() 0 3 1
A getListWithoutSeparator() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Framework\Kernel\Test\Unit;
15
16
use Micro\Framework\Kernel\Configuration\PluginConfiguration;
17
18
/**
19
 * @author Stanislau Komar <[email protected]>
20
 */
21
class ConfigurableTestPluginConfiguration extends PluginConfiguration
22
{
23
    public function getEnv(): string
24
    {
25
        return $this->configuration->get('APP_ENV', null, false);
26
    }
27
28
    public function getList(): array
29
    {
30
        $list = $this->configuration->get('ENV_LIST', null, false);
31
32
        return $this->explodeStringToArray($list);
33
    }
34
35
    public function getAlreadyList(): array
36
    {
37
        return $this->explodeStringToArray($this->getList());
38
    }
39
40
    public function getListWithoutSeparator(): array
41
    {
42
        return $this->explodeStringToArray($this->configuration->get('ENV_LIST', null, false), '');
43
    }
44
45
    public function getRoutingKeyConfig(): ConfigurableTestPluginRoutingConfiguration
46
    {
47
        return new ConfigurableTestPluginRoutingConfiguration($this->configuration, 'TEST');
48
    }
49
}
50