Passed
Push — master ( 24c04a...5c4bac )
by butschster
15:41 queued 05:00
created

DebugConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTags() 0 3 1
A getCollectors() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Debug\Config;
6
7
use Spiral\Core\Container\Autowire;
8
use Spiral\Core\InjectableConfig;
9
use Spiral\Debug\StateCollectorInterface;
10
11
/**
12
 * @psalm-type TCollector = StateCollectorInterface|string|Autowire<StateCollectorInterface>
13
 * @psalm-type TTag = non-empty-string|\Closure|\Stringable
14
 * @property array{
15
 *     collectors: array<TCollector>,
16
 *     tags: array<non-empty-string, TTag>
17
 * } $config
18
 */
19
final class DebugConfig extends InjectableConfig
20
{
21
    public const CONFIG = 'debug';
22
23
    protected array $config = [
24
        'collectors' => [],
25
        'tags' => [],
26
    ];
27
28
    /**
29
     * @return array<TCollector>
30
     */
31 8
    public function getCollectors(): array
32
    {
33 8
        return $this->config['collectors'];
34
    }
35
36
    /**
37
     * @return array<non-empty-string, TTag>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<non-empty-string, TTag> at position 2 could not be parsed: Unknown type name 'non-empty-string' at position 2 in array<non-empty-string, TTag>.
Loading history...
38
     */
39 10
    public function getTags(): array
40
    {
41 10
        return $this->config['tags'];
42
    }
43
}
44