Completed
Push — master ( c842a6...0ae0f9 )
by Andrii
15:39
created

ScrutinizerController::actionRunOcular()   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 0
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-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hidev\scrutinizer\controllers;
13
14
/**
15
 * Goal for Scrutinizer.
16
 */
17
class ScrutinizerController extends \hidev\controllers\CommonController
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']);
36
    }
37
}
38