Output   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 7

5 Methods

Rating   Name   Duplication   Size   Complexity  
A separator() 0 3 1
A success() 0 3 1
A info() 0 3 1
A arrayList() 0 7 3
A warn() 0 3 1
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