Completed
Push — master ( f9eb6d...e149f7 )
by Andrii
07:39
created

Hidev   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 14
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A exec() 0 11 3
1
<?php
2
/**
3
 * Automation tool mixed with code generator for easier continuous development
4
 *
5
 * @link      https://github.com/hiqdev/hidev
6
 * @package   hidev
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\helpers;
12
13
use Yii;
14
15
/**
16
 * Hidev helper.
17
 */
18
class Hidev
19
{
20
    public static function exec($route, array $args, $wait = false)
21
    {
22
        $path = dirname(__DIR__) . '/bin/hidev';
23
        $command = "$path $route";
24
        foreach ($args as $arg) {
25
            $command .= ' ' . escapeshellarg($arg);
26
        }
27
        $amp = $wait ? '' : '&';
28
29
        return exec("$command > /dev/null 2>&1 $amp");
30
    }
31
}
32