1 | <?php |
||
25 | class ConsoleInput extends ConsoleInputBase |
||
26 | { |
||
27 | /** |
||
28 | * Reply values for ask() and askChoice() |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $replies = []; |
||
33 | |||
34 | /** |
||
35 | * Current message index |
||
36 | * |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $currentIndex = -1; |
||
40 | |||
41 | /** |
||
42 | * Constructor |
||
43 | * |
||
44 | * @param string[] $replies A list of replies for read() |
||
45 | */ |
||
46 | public function __construct(array $replies) |
||
52 | |||
53 | /** |
||
54 | * Read a reply |
||
55 | * |
||
56 | * @return mixed The value of the reply |
||
57 | */ |
||
58 | public function read() |
||
72 | |||
73 | /** |
||
74 | * Check if data is available on stdin |
||
75 | * |
||
76 | * @param int $timeout An optional time to wait for data |
||
77 | * @return bool True for data available, false otherwise |
||
78 | */ |
||
79 | public function dataAvailable($timeout = 0) |
||
83 | } |
||
84 |