Runner   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 13 3
A runPHPCS() 0 5 1
A runPHPCBF() 0 5 1
1
<?php
2
3
namespace SugaredRim\PHP\CodeSniffer;
4
5
class Runner extends \PHP_CodeSniffer\Runner
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $sugaredRimTrigger;
11
12
    /**
13
     * @inheritDoc
14
     */
15
    public function init():void
16
    {
17
        $this->config = new Config();
18
19
        // v3.* and still sucks :-(
20
        if ($this->sugaredRimTrigger === 'runPHPCBF') {
21
            if ($this->config->stdin === true) {
22
                $this->config->verbosity = 0;
23
            }
24
        }
25
26
        parent::init();
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function runPHPCS()
33
    {
34
        $this->sugaredRimTrigger = 'runPHPCS';
35
        return parent::runPHPCS();
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41
    public function runPHPCBF()
42
    {
43
        $this->sugaredRimTrigger = 'runPHPCBF';
44
        return parent::runPHPCBF();
45
    }
46
}
47