Code Duplication    Length = 21-21 lines in 2 locations

src/Command/CommandShowConfig.php 1 location

@@ 54-74 (lines=21) @@
51
     * @param array $array
52
     * @param int $column
53
     */
54
    private function printArray($array, $column = -2)
55
    {
56
        $output = '';
57
58
        if (is_array($array)) {
59
            $column += 2;
60
            foreach ($array as $key => $val) {
61
                if (is_array($val)) {
62
                    $output .= str_repeat(' ', $column) . "$key:\n" . $this->printArray($val, $column);
63
                }
64
                if (is_string($val) || is_int($val)) {
65
                    $output .= str_repeat(' ', $column) . "$key: $val\n";
66
                }
67
                if (is_bool($val)) {
68
                    $output .= str_repeat(' ', $column) . "$key: " . ($val ? 'true' : 'false') . "\n";
69
                }
70
            }
71
        }
72
73
        return $output;
74
    }
75
}
76

src/Command/Config.php 1 location

@@ 33-53 (lines=21) @@
30
    /**
31
     * Print an array in console.
32
     */
33
    private function printArray($array, $column = -4)
34
    {
35
        $output = '';
36
37
        if (is_array($array)) {
38
            $column += 4;
39
            foreach ($array as $key => $val) {
40
                if (is_array($val)) {
41
                    $output .= str_repeat(' ', $column)."$key:\n".$this->printArray($val, $column);
42
                }
43
                if (is_string($val) || is_int($val)) {
44
                    $output .= str_repeat(' ', $column)."$key: $val\n";
45
                }
46
                if (is_bool($val)) {
47
                    $output .= str_repeat(' ', $column)."$key: ".($val ? 'true' : 'false')."\n";
48
                }
49
            }
50
        }
51
52
        return $output;
53
    }
54
}
55