| 1 | <?php |
||
| 10 | class Text implements Input |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var InputIO |
||
| 14 | */ |
||
| 15 | private $inputIO; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $promptText = 'Enter text:'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | private $validationFailedText = 'Invalid, try again'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $placeholderText = ''; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var MenuStyle |
||
| 34 | */ |
||
| 35 | private $style; |
||
| 36 | |||
| 37 | public function __construct(InputIO $inputIO, MenuStyle $style) |
||
| 42 | |||
| 43 | public function setPromptText(string $promptText) : Input |
||
| 49 | |||
| 50 | public function getPromptText() : string |
||
| 54 | |||
| 55 | public function setValidationFailedText(string $validationFailedText) : Input |
||
| 61 | |||
| 62 | public function getValidationFailedText() : string |
||
| 66 | |||
| 67 | public function setPlaceholderText(string $placeholderText) : Input |
||
| 73 | |||
| 74 | public function getPlaceholderText() : string |
||
| 78 | |||
| 79 | public function ask() : InputResult |
||
| 83 | |||
| 84 | public function validate(string $input) : bool |
||
| 88 | |||
| 89 | public function filter(string $value) : string |
||
| 93 | |||
| 94 | public function getStyle() : MenuStyle |
||
| 98 | } |
||
| 99 |