mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 08:58:56 +02:00
PHPStorm refactoring.
This commit is contained in:
+25
-25
@@ -19,27 +19,27 @@ use Mage\Config;
|
||||
*/
|
||||
class Colors
|
||||
{
|
||||
/**
|
||||
* List of Colors and they Terminal/Console representation.
|
||||
* @var array
|
||||
*/
|
||||
/**
|
||||
* List of Colors and they Terminal/Console representation.
|
||||
* @var array
|
||||
*/
|
||||
private static $foregroundColors = array(
|
||||
'black' => '0;30',
|
||||
'dark_gray' => '1;30',
|
||||
'blue' => '0;34',
|
||||
'light_blue' => '1;34',
|
||||
'green' => '0;32',
|
||||
'light_green' => '1;32',
|
||||
'cyan' => '0;36',
|
||||
'light_cyan' => '1;36',
|
||||
'red' => '0;31',
|
||||
'light_red' => '1;31',
|
||||
'purple' => '0;35',
|
||||
'black' => '0;30',
|
||||
'dark_gray' => '1;30',
|
||||
'blue' => '0;34',
|
||||
'light_blue' => '1;34',
|
||||
'green' => '0;32',
|
||||
'light_green' => '1;32',
|
||||
'cyan' => '0;36',
|
||||
'light_cyan' => '1;36',
|
||||
'red' => '0;31',
|
||||
'light_red' => '1;31',
|
||||
'purple' => '0;35',
|
||||
'light_purple' => '1;35',
|
||||
'brown' => '0;33',
|
||||
'yellow' => '1;33',
|
||||
'light_gray' => '0;37',
|
||||
'white' => '1;37'
|
||||
'brown' => '0;33',
|
||||
'yellow' => '1;33',
|
||||
'light_gray' => '0;37',
|
||||
'white' => '1;37'
|
||||
|
||||
);
|
||||
|
||||
@@ -52,17 +52,17 @@ class Colors
|
||||
*/
|
||||
public static function color($string, Config $config)
|
||||
{
|
||||
$disabled = $config->getParameter('no-color', !$config->general('colors', true));
|
||||
$disabled = $config->getParameter('no-color', !$config->general('colors', true));
|
||||
|
||||
if ($disabled) {
|
||||
$string = strip_tags($string);
|
||||
return $string;
|
||||
}
|
||||
if ($disabled) {
|
||||
$string = strip_tags($string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
foreach (self::$foregroundColors as $key => $code) {
|
||||
$replaceFrom = array(
|
||||
'<' . $key . '>',
|
||||
'</' . $key . '>'
|
||||
'</' . $key . '>'
|
||||
);
|
||||
|
||||
$replaceTo = array(
|
||||
|
||||
Reference in New Issue
Block a user