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

CommandHydrator::hydrate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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