1 | <?php |
||
29 | class BufferedIO extends IO |
||
30 | { |
||
31 | /** |
||
32 | * Creates the I/O. |
||
33 | * |
||
34 | * @param string $inputData The data to return from the input. |
||
35 | * @param Formatter $formatter The formatter to use. |
||
|
|||
36 | */ |
||
37 | 158 | public function __construct($inputData = '', Formatter $formatter = null) |
|
38 | { |
||
39 | 158 | $formatter = $formatter ?: new PlainFormatter(); |
|
40 | 158 | $input = new Input(new StringInputStream($inputData)); |
|
41 | 158 | $output = new Output(new BufferedOutputStream(), $formatter); |
|
42 | 158 | $errorOutput = new Output(new BufferedOutputStream(), $formatter); |
|
43 | |||
44 | 158 | parent::__construct($input, $output, $errorOutput); |
|
45 | 158 | } |
|
46 | |||
47 | /** |
||
48 | * Sets the contents of the input buffer. |
||
49 | * |
||
50 | * @param string $data The input data. |
||
51 | */ |
||
52 | 3 | public function setInput($data) |
|
56 | |||
57 | /** |
||
58 | * Appends data to the input buffer. |
||
59 | * |
||
60 | * @param string $data The input data to append. |
||
61 | */ |
||
62 | 1 | public function appendInput($data) |
|
66 | |||
67 | /** |
||
68 | * Clears the input buffer. |
||
69 | */ |
||
70 | 1 | public function clearInput() |
|
74 | |||
75 | /** |
||
76 | * Returns the contents of the output buffer. |
||
77 | * |
||
78 | * @return string The output data. |
||
79 | */ |
||
80 | 93 | public function fetchOutput() |
|
84 | |||
85 | /** |
||
86 | * Clears the output buffer. |
||
87 | */ |
||
88 | 1 | public function clearOutput() |
|
92 | |||
93 | /** |
||
94 | * Returns the contents of the error output buffer. |
||
95 | * |
||
96 | * @return string The data of the error output. |
||
97 | */ |
||
98 | 6 | public function fetchErrors() |
|
102 | |||
103 | /** |
||
104 | * Clears the error output buffer. |
||
105 | */ |
||
106 | 1 | public function clearErrors() |
|
110 | } |
||
111 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.