-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split into command classes
- Loading branch information
1 parent
3b65bdb
commit a8aad64
Showing
23 changed files
with
1,002 additions
and
699 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Rocket; | ||
|
||
class ColorOutput implements OutputInterface | ||
{ | ||
/** | ||
* @param string $text | ||
*/ | ||
public function plain($text) | ||
{ | ||
echo $text . PHP_EOL; | ||
} | ||
|
||
/** | ||
* @param string $text | ||
*/ | ||
public function error($text) | ||
{ | ||
$escapeSequence = new EscapeSequence('red', null, ['bold']); | ||
echo $escapeSequence->apply($text) . PHP_EOL; | ||
} | ||
|
||
/** | ||
* @param string $text | ||
*/ | ||
public function warning($text) | ||
{ | ||
$escapeSequence = new EscapeSequence('magenta', null, ['bold']); | ||
echo $escapeSequence->apply($text) . PHP_EOL; | ||
} | ||
|
||
/** | ||
* @param string $text | ||
*/ | ||
public function info($text) | ||
{ | ||
$escapeSequence = new EscapeSequence('cyan', null, ['bold']); | ||
echo $escapeSequence->apply($text) . PHP_EOL; | ||
} | ||
|
||
/** | ||
* @param string $text | ||
*/ | ||
public function debug($text) | ||
{ | ||
$escapeSequence = new EscapeSequence(null, null, ['underline', 'brink']); | ||
echo $escapeSequence->apply($text) . PHP_EOL; | ||
} | ||
} |
Oops, something went wrong.