Skip to content

Commit 2e5cbd5

Browse files
authored
Add verbosity level checking to console alerts. (#44614)
1 parent e28510d commit 2e5cbd5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Illuminate/Console/Concerns/InteractsWithIO.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,18 @@ public function warn($string, $verbosity = null)
364364
* Write a string in an alert box.
365365
*
366366
* @param string $string
367+
* @param int|string|null $verbosity
367368
* @return void
368369
*/
369-
public function alert($string)
370+
public function alert($string, $verbosity = null)
370371
{
371372
$length = Str::length(strip_tags($string)) + 12;
372373

373-
$this->comment(str_repeat('*', $length));
374-
$this->comment('* '.$string.' *');
375-
$this->comment(str_repeat('*', $length));
374+
$this->comment(str_repeat('*', $length), $verbosity);
375+
$this->comment('* '.$string.' *', $verbosity);
376+
$this->comment(str_repeat('*', $length), $verbosity);
376377

377-
$this->newLine();
378+
$this->comment('', $verbosity);
378379
}
379380

380381
/**

0 commit comments

Comments
 (0)