1 | <?php |
||
8 | class Stdin implements ReaderInterface |
||
9 | { |
||
10 | protected $stdIn = false; |
||
11 | |||
12 | /** |
||
13 | * Read the line typed in by the user |
||
14 | * |
||
15 | * @return string |
||
16 | 4 | */ |
|
17 | public function line() |
||
21 | |||
22 | /** |
||
23 | * Read from STDIN until EOF (^D) is reached |
||
24 | * |
||
25 | * @return string |
||
26 | 4 | */ |
|
27 | public function multiLine() |
||
31 | |||
32 | /** |
||
33 | * Read one character |
||
34 | * |
||
35 | * @param int $count |
||
36 | * |
||
37 | * @return string |
||
38 | 4 | */ |
|
39 | public function char($count = 1) |
||
43 | |||
44 | /** |
||
45 | * Read the line, but hide what the user is typing |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function hidden() |
||
53 | |||
54 | /** |
||
55 | * Return a valid STDIN, even if it previously EOF'ed |
||
56 | * |
||
57 | * Lazily re-opens STDIN after hitting an EOF |
||
58 | * |
||
59 | * @return resource |
||
60 | * @throws RuntimeException |
||
61 | 12 | */ |
|
62 | protected function getStdIn() |
||
76 | |||
77 | /** |
||
78 | * Attempt to set the stdin property |
||
79 | * |
||
80 | * @return void |
||
81 | 12 | * @throws RuntimeException |
|
82 | */ |
||
83 | 12 | protected function setStdIn() |
|
95 | } |
||
96 |