Passed
Pull Request — master (#58)
by Dmitriy
02:35
created

ParametersProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplates() 0 4 1
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Gii;
6
7
final class ParametersProvider
8
{
9 4
    public function __construct(
10
        /**
11
         * @var array<string, array<string, string>> a list of available code templates. The array keys are the template names,
12
         * and the array values are the corresponding template paths or path aliases.
13
         */
14
        private array $templates = [],
15
    ) {
16
    }
17
18 2
    public function getTemplates(string $generator): array
19
    {
20 2
        $templates = $this->templates[$generator] ?? [];
21 2
        return ['default' => true, ...$templates];
22
    }
23
}
24