TerminalHelper::taskReport()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 2
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\PHPTravisEnhancer\Terminal;
4
5
trait TerminalHelper
6
{
7
    /**
8
     * Render a green tick in the terminal
9
     */
10
    private function tick(): void
11
    {
12
        $this->climate->bold()->green('✓');
13
    }
14
15
16
    /**
17
     * Render a red cross in the terminial
18
     */
19
    private function cross(): void
20
    {
21
        $this->climate->bold()->red('✘');
22
    }
23
24
25
    private function taskReport(string $message, int $retVal = 0): void
26
    {
27
        $this->climate->inline($message . '  ');
28
        if ($retVal !== 0) {
29
            $this->cross();
30
        } else {
31
            $this->tick();
32
        }
33
    }
34
}
35