Passed
Pull Request — master (#58)
by Alexander
05:11 queued 02:28
created

CommandHydrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 2 Features 0
Metric Value
wmc 2
eloc 2
c 4
b 2
f 0
dl 0
loc 12
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
    public function hydrate(string $commandClass, array $parameters): GeneratorCommandInterface
19
    {
20
        return new $commandClass(...$parameters);
21
    }
22
}
23