Skip to content

Commit 09cc54b

Browse files
authored
Merge pull request #7 from flavienbwk/added-php-eol-return
Added PHP_EOL to the return of method getColoredString
2 parents fc0333f + eb3984c commit 09cc54b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ require_once __DIR__ . './../vendor/autoload.php';
1818

1919
$colors = new Wujunze\Colors();
2020
// Test some basic printing with Colors class
21-
echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow") . PHP_EOL;
22-
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray") . PHP_EOL;
23-
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black") . PHP_EOL;
24-
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green") . PHP_EOL;
25-
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan") . PHP_EOL;
26-
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan") . PHP_EOL;
21+
echo $colors->getColoredString("Testing Colors class, this is purple string on yellow background.", "purple", "yellow");
22+
echo $colors->getColoredString("Testing Colors class, this is blue string on light gray background.", "blue", "light_gray");
23+
echo $colors->getColoredString("Testing Colors class, this is red string on black background.", "red", "black");
24+
echo $colors->getColoredString("Testing Colors class, this is cyan string on green background.", "cyan", "green");
25+
echo $colors->getColoredString("Testing Colors class, this is cyan string on default background.", "cyan");
26+
echo $colors->getColoredString("Testing Colors class, this is default string on cyan background.", null, "cyan");
2727
```
2828

2929
## run result

src/Colors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getColoredString($string, $foreground_color = null, $background_
8484
// Add string and end coloring
8585
$colored_string .= $string . "\033[0m";
8686

87-
return $colored_string;
87+
return $colored_string . PHP_EOL;
8888
}
8989

9090
// Returns all foreground color names

0 commit comments

Comments
 (0)