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

GiiParametersProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 20
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getRequiredTemplates() 0 3 1
A getTemplates() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Gii;
6
7
class GiiParametersProvider
8
{
9 4
    public function __construct(
10
        /**
11
         * @var 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 $controllerId): array
19
    {
20 2
        $templates = $this->templates[$controllerId] ?? [];
21 2
        return array_merge(['default' => true], $templates);
22
    }
23
24
    public function getRequiredTemplates(): array
25
    {
26
        return [];
27
    }
28
}
29