Passed
Pull Request — master (#369)
by Mihai
03:23
created

PhiveInstallCommandFactory::import()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Zalas\Toolbox\Json\Factory;
4
5
use Zalas\Toolbox\Tool\Command;
6
use Zalas\Toolbox\Tool\Command\PhiveInstallCommand;
7
8
final class PhiveInstallCommandFactory
9
{
10 5
    public static function import(array $command): Command
11
    {
12 5
        Assert::requireFields(['alias', 'bin'], $command, 'PhiveInstallCommand');
13
14 3
        return new PhiveInstallCommand($command['alias'], $command['bin'], $command['unsigned'] ?? false);
15
    }
16
}
17