Skip to content

Commit 258c69c

Browse files
committed
feat(helpers): Added writeWarning helper
1 parent 9a3b5e7 commit 258c69c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Helpers/WsTools.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
protected $helper;
2424
protected $input;
2525

26-
protected static $types = array('error', 'success', 'info', 'comment', 'link', 'header', 'mark');
26+
protected static $types = array('error', 'warning', 'success', 'info', 'comment', 'link', 'header', 'mark');
2727

2828
/**
2929
* Construct WsTools
@@ -51,6 +51,9 @@ public function __construct(OutputInterface $output) {
5151

5252
$style = new OutputFormatterStyle('blue', 'white', array('reverse'));
5353
$output->getFormatter()->setStyle('mark', $style);
54+
55+
$style = new OutputFormatterStyle('yellow', null, array('bold'));
56+
$output->getFormatter()->setStyle('warning', $style);
5457
}
5558

5659
/**
@@ -167,6 +170,17 @@ public function writeErrorAndExit($string) {
167170
public function writeComment($string, $write = true) {
168171
return $this->write($string, 'comment', $write);
169172
}
173+
174+
/**
175+
* Simple method for coloring warning output
176+
*
177+
* @param string $string
178+
* @param boolean $write
179+
* @return tinted string
180+
*/
181+
public function writeWarning($string, $write = true) {
182+
return $this->write($string, 'warning', $write);
183+
}
170184

171185
/**
172186
* Simple method for coloring info output

0 commit comments

Comments
 (0)