Hidev::exec()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

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