Hidev   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A exec() 0 10 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
/**
14
 * Hidev helper.
15
 */
16
class Hidev
17
{
18
    public static function exec($route, array $args, $wait = false)
19
    {
20
        $path = dirname(__DIR__) . '/bin/hidev';
21
        $command = "$path $route";
22
        foreach ($args as $arg) {
23
            $command .= ' ' . escapeshellarg($arg);
24
        }
25
        $amp = $wait ? '' : '&';
26
27
        return exec("$command > /dev/null 2>&1 $amp");
28
    }
29
}
30