@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * @return ConsoleHelper |
| 28 | 28 | */ |
| 29 | 29 | public static function get() { |
| 30 | - if(!isset(self::$_instance)) { |
|
| 30 | + if (!isset(self::$_instance)) { |
|
| 31 | 31 | self::$_instance = new ConsoleHelper(); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | ]; |
| 32 | 32 | |
| 33 | 33 | public function styled($style, $text) { |
| 34 | - return $this->open($style).$text.$this->close(); |
|
| 34 | + return $this->open($style) . $text . $this->close(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function open($style) |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function close() |
| 49 | 49 | { |
| 50 | 50 | $this->_current = empty($this->_stack) ? $this->_default : array_pop($this->_stack); |
| 51 | - return "\033[0m".$this->_set(array_diff($this->_current, $this->_default)); |
|
| 51 | + return "\033[0m" . $this->_set(array_diff($this->_current, $this->_default)); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | private function _color($name, $bg = false) |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | private function _style($name, $value) { |
| 80 | - switch($name) { |
|
| 80 | + switch ($name) { |
|
| 81 | 81 | case 'color': |
| 82 | 82 | return $this->_color($value); |
| 83 | 83 | case 'background': |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | private function _set($style) { |
| 101 | - $escape = "\e[".implode(';', array_map(function($style, $name) { |
|
| 101 | + $escape = "\e[" . implode(';', array_map(function($style, $name) { |
|
| 102 | 102 | return $this->_style($style, $name); |
| 103 | - }, array_keys($style), $style)).'m'; |
|
| 103 | + }, array_keys($style), $style)) . 'm'; |
|
| 104 | 104 | |
| 105 | 105 | return $escape === "\e[m" ? null : $escape; |
| 106 | 106 | } |