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

Binaries   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getItemConfig() 0 7 1
A passthru() 0 4 1
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