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

CommandHydrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

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
     *
19
     */
20
    public function hydrate(string $commandClass, array $parameters): GeneratorCommandInterface
21
    {
22
        return new $commandClass(...$parameters);
23
    }
24
}
25