TerminalHelper::tick()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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