@@ 406-417 (lines=12) @@ | ||
403 | * @param string $text |
|
404 | * @return Flash |
|
405 | */ |
|
406 | public function flash($text) |
|
407 | { |
|
408 | if (strpos($text, "\n") !== false) { |
|
409 | throw new \InvalidArgumentException; |
|
410 | } |
|
411 | ||
412 | $style = (new MenuStyle($this->terminal)) |
|
413 | ->setBg('yellow') |
|
414 | ->setFg('red'); |
|
415 | ||
416 | return new Flash($this, $style, $this->terminal, $text); |
|
417 | } |
|
418 | ||
419 | /** |
|
420 | * @param string $text |
|
@@ 423-434 (lines=12) @@ | ||
420 | * @param string $text |
|
421 | * @return Confirm |
|
422 | */ |
|
423 | public function confirm($text) |
|
424 | { |
|
425 | if (strpos($text, "\n") !== false) { |
|
426 | throw new \InvalidArgumentException; |
|
427 | } |
|
428 | ||
429 | $style = (new MenuStyle($this->terminal)) |
|
430 | ->setBg('yellow') |
|
431 | ->setFg('red'); |
|
432 | ||
433 | return new Confirm($this, $style, $this->terminal, $text); |
|
434 | } |
|
435 | } |
|
436 |