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

CommandHydrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A hydrate() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Gii\Generator;
6
7
use Yiisoft\Yii\Gii\GeneratorCommandInterface;
8
9
class CommandHydrator
10
{
11
    public function __construct()
12
    {
13
    }
14
15
    /**
16
     * @psalm-param class-string<GeneratorCommandInterface> $commandClass
17
     *
18
     * @param array $parameters
19
     *
20
     * @return GeneratorCommandInterface
21
     */
22
    public function hydrate(string $commandClass, array $parameters): GeneratorCommandInterface
23
    {
24
        return new $commandClass(...$parameters);
25
    }
26
}
27