Completed
Push — master ( 26ef17...48e280 )
by Andrii
12:40
created

PhpCsFixerController::determineVersion()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * PHP-CS-Fixer plugin for HiDev
4
 *
5
 * @link      https://github.com/hiqdev/hidev-php-cs-fixer
6
 * @package   hidev-php-cs-fixer
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\phpcsfixer\console;
12
13
/**
14
 * php-cs-fixer.
15
 */
16
class PhpCsFixerController extends \hidev\base\Controller
17
{
18
    protected $_before = ['.php_cs'];
19
20
    public function actionIndex()
21
    {
22
        return $this->doFix();
23
    }
24
25
    public function doFix()
26
    {
27
        return $this->passthru('php-cs-fixer', ['fix']);
28
    }
29
30
    public function actionCheck()
31
    {
32
        return $this->passthru('php-cs-fixer', ['fix', '--dry-run']);
33
    }
34
}
35