/** * Reads a line from the input stream. * * @param string $default The default to return if interaction is disabled. * @param int $length The maximum number of characters to read. If * `null`, all characters up to the first newline are * returned. * * @return string The characters read from the input stream. * * @throws IOException If reading fails or if the input stream is closed. */ public function readLine($default = null, $length = null) { if (!$this->interactive) { return $default; } return $this->stream->readLine($length); }