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

ParametersProvider::getTemplates()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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