PhpCsController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0
ccs 0
cts 6
cp 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplate() 0 7 1
A getFixer() 0 4 1
A actionIndex() 0 4 1
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` (php-cs-fixer config) file generation.
15
 */
16
class PhpCsController extends \hidev\base\Controller
17
{
18
    public function getTemplate()
19
    {
20
        $version = $this->getFixer()->getVersion();
21
        $vno = substr($version, 0, 1);
22
23
        return "php-cs-v$vno.twig";
24
    }
25
26
    public function getFixer()
27
    {
28
        return $this->take('php-cs-fixer');
29
    }
30
31
    public function actionIndex()
32
    {
33
        $this->take('.php_cs')->save();
34
    }
35
}
36