Completed
Push — master ( dde429...22637e )
by Andrii
20:00
created

Binaries::passthru()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/*
4
 * Task runner, code generator and build tool for easier continuos integration
5
 *
6
 * @link      https://github.com/hiqdev/hidev
7
 * @package   hidev
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\components;
13
14
class Binaries extends \hiqdev\yii2\collection\Manager
15
{
16
    public $defaultClass = 'hidev\base\BinaryPhp';
17
18
    /**
19
     * Prepares item config.
20
     */
21
    public function getItemConfig($name = null, array $config = [])
22
    {
23
        return array_merge([
24
            'name'  => $name,
25
            'class' => $this->defaultClass,
26
        ], $config);
27
    }
28
29
    /**
30
     * Prepares and runs with passthru.
31
     * @param string $name binary
32
     * @param string $args
33
     * @return int exit code
34
     */
35
    public function passthru($name, $args = [])
36
    {
37
        return $this->get($name)->passthru($args);
38
    }
39
}
40