Completed
Push — output_parsers_refactor ( ea70d9...668933 )
by Alessandro
02:32
created

ConsoleFormatter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 0
cbo 4
dl 0
loc 28
ccs 15
cts 15
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A onEngineStart() 0 22 2
1
<?php
2
3
namespace Paraunit\Printer;
4
5
use Paraunit\Lifecycle\EngineEvent;
6
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
7
8
/**
9
 * Class ConsoleFormatter
10
 * @package Paraunit\Printer
11
 */
12
class ConsoleFormatter
13
{
14
    /**
15
     * @param EngineEvent $engineEvent
16
     */
17 7
    public function onEngineStart(EngineEvent $engineEvent)
18
    {
19
20 7
        $outputInterface= $engineEvent->getOutputInterface();
21
22 7
        if ($outputInterface->getFormatter()) {
23 7
            $style = new OutputFormatterStyle('green', null, array('bold', 'blink'));
24 7
            $outputInterface->getFormatter()->setStyle('ok', $style);
25
26 7
            $style = new OutputFormatterStyle('yellow', null, array('bold', 'blink'));
27 7
            $outputInterface->getFormatter()->setStyle('skipped', $style);
28
29 7
            $style = new OutputFormatterStyle('blue', null, array('bold', 'blink'));
30 7
            $outputInterface->getFormatter()->setStyle('incomplete', $style);
31
32 7
            $style = new OutputFormatterStyle('red', null, array('bold', 'blink'));
33 7
            $outputInterface->getFormatter()->setStyle('fail', $style);
34
35 7
            $style = new OutputFormatterStyle('red', null, array('bold', 'blink'));
36 7
            $outputInterface->getFormatter()->setStyle('error', $style);
37 7
        }
38 7
    }
39
}
40