Completed
Push — master ( f0de11...588d0d )
by Andrii
04:01
created

BoxGoal   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 31
ccs 0
cts 21
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A options() 0 4 1
A getConfiguration() 0 4 1
A actionMake() 0 4 1
A actionBuild() 0 6 1
1
<?php
2
3
/*
4
 * Box plugin for HiDev
5
 *
6
 * @link      https://github.com/hiqdev/hidev-box
7
 * @package   hidev-box
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\box\goals;
13
14
/**
15
 * Goal for Box.
16
 */
17
class BoxGoal extends \hidev\goals\DefaultGoal
18
{
19
    public $configFile = 'box.json';
20
21
    public function init()
22
    {
23
        $this->setDeps($this->configFile);
24
    }
25
26
    public function options($action)
27
    {
28
        return array_merge(parent::options($action), ['force', 'coverageText', 'coverageClover']);
29
    }
30
31
    public function getConfiguration()
32
    {
33
        return $this->config->get($this->configFile);
0 ignored issues
show
Bug introduced by
The property config does not seem to exist. Did you mean configFile?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
34
    }
35
36
    public function actionMake()
37
    {
38
        return $this->actionBuild();
39
    }
40
41
    public function actionBuild()
42
    {
43
        $args = ['build'];
44
45
        return $this->passthru('box', $args);
0 ignored issues
show
Documentation introduced by
$args is of type array<integer,string,{"0":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
46
    }
47
}
48