Output::info()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by solly [18.10.17 7:15]
4
 */
5
6
namespace insolita\codestat\helpers;
7
8
use yii\helpers\BaseConsole;
9
10
class Output extends BaseConsole
11
{
12
    /**
13
     * @param array $data
14
     * @param bool  $withIndex
15
     */
16
    public static function arrayList(array $data, $withIndex = true)
17
    {
18
        foreach ($data as $index => $line) {
19
            if ($withIndex) {
20
                self::stdout(' ' . $index . ' - ');
21
            }
22
            self::output($line);
23
        }
24
    }
25
    
26
    
27
    public static function separator($string = '-', $multiplier = 25)
28
    {
29
        self::output(str_repeat($string, $multiplier));
30
    }
31
    
32
    public static function info($string)
33
    {
34
        self::output(self::ansiFormat($string, [self::FG_CYAN]));
35
    }
36
    
37
    public static function success($string)
38
    {
39
        self::output(self::ansiFormat($string, [self::FG_GREEN]));
40
    }
41
    
42
    public static function warn($string)
43
    {
44
        self::output(self::ansiFormat($string, [self::FG_PURPLE]));
45
    }
46
}
47