Completed
Push — master ( 8293e4...9f993a )
by Andrii
11:05
created

src/goals/ScrutinizerGoal.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * Scrutinizer plugin for HiDev
5
 *
6
 * @link      https://github.com/hiqdev/hidev-scrutinizer
7
 * @package   hidev-scrutinizer
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\scrutinizer\goals;
13
14
/**
15
 * Goal for Scrutinizer.
16
 */
17
class ScrutinizerGoal extends \hidev\goals\DefaultGoal
18
{
19
    public function actionUploadCoverage()
20
    {
21
        return $this->runActions(['wget-ocular', 'run-ocular']);
22
    }
23
24
    public function actionWgetOcular()
25
    {
26
        if (file_exists('ocular.phar')) {
27
            return 0;
28
        }
29
30
        return $this->passthru('wget', 'https://scrutinizer-ci.com/ocular.phar');
31
    }
32
33
    public function actionRunOcular()
34
    {
35
        return $this->passthru('ocular', ['code-coverage:upload', '--format=php-clover', 'coverage.clover']);
0 ignored issues
show
array('code-coverage:upl...er', 'coverage.clover') is of type array<integer,string,{"0..."string","2":"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...
36
    }
37
}
38