| @@ 408-419 (lines=12) @@ | ||
| 405 | * @param string $text |
|
| 406 | * @return Flash |
|
| 407 | */ |
|
| 408 | public function flash($text) |
|
| 409 | { |
|
| 410 | if (strpos($text, "\n") !== false) { |
|
| 411 | throw new \InvalidArgumentException; |
|
| 412 | } |
|
| 413 | ||
| 414 | $style = (new MenuStyle($this->terminal)) |
|
| 415 | ->setBg('yellow') |
|
| 416 | ->setFg('red'); |
|
| 417 | ||
| 418 | return new Flash($this, $style, $this->terminal, $text); |
|
| 419 | } |
|
| 420 | ||
| 421 | /** |
|
| 422 | * @param string $text |
|
| @@ 425-436 (lines=12) @@ | ||
| 422 | * @param string $text |
|
| 423 | * @return Confirm |
|
| 424 | */ |
|
| 425 | public function confirm($text) |
|
| 426 | { |
|
| 427 | if (strpos($text, "\n") !== false) { |
|
| 428 | throw new \InvalidArgumentException; |
|
| 429 | } |
|
| 430 | ||
| 431 | $style = (new MenuStyle($this->terminal)) |
|
| 432 | ->setBg('yellow') |
|
| 433 | ->setFg('red'); |
|
| 434 | ||
| 435 | return new Confirm($this, $style, $this->terminal, $text); |
|
| 436 | } |
|
| 437 | /** |
|
| 438 | * @param string $text |
|
| 439 | * @return YesNo |
|
| @@ 441-452 (lines=12) @@ | ||
| 438 | * @param string $text |
|
| 439 | * @return YesNo |
|
| 440 | */ |
|
| 441 | public function yesNo($text) |
|
| 442 | { |
|
| 443 | if (strpos($text, "\n") !== false) { |
|
| 444 | throw new \InvalidArgumentException; |
|
| 445 | } |
|
| 446 | ||
| 447 | $style = (new MenuStyle($this->terminal)) |
|
| 448 | ->setBg('yellow') |
|
| 449 | ->setFg('red'); |
|
| 450 | ||
| 451 | return new YesNo($this, $style, $this->terminal, $text); |
|
| 452 | } |
|
| 453 | } |
|
| 454 | ||