protected function readline()
    {
        if (!empty($this->inputBuffer)) {
            $line = \array_shift($this->inputBuffer);
            if (!$line instanceof SilentInput) {
                $this->output->writeln(\sprintf('<aside>%s %s</aside>', static::REPLAY, OutputFormatter::escape($line)));
            }

            return $line;
        }

        if ($bracketedPaste = $this->config->useBracketedPaste()) {
            \printf("\e[?2004h"); // Enable bracketed paste
        }

        $line = $this->readline->readline($this->getPrompt());

        if ($bracketedPaste) {
            \printf("\e[?2004l"); // ... and disable it again
        }

        return $line;
    }
protected function readline()
    {
        if (!empty($this->inputBuffer)) {
            $line = \array_shift($this->inputBuffer);
            if (!$line instanceof SilentInput) {
                $this->output->writeln(\sprintf('<aside>%s %s</aside>', static::REPLAY, OutputFormatter::escape($line)));
            }

            return $line;
        }

        if ($bracketedPaste = $this->config->useBracketedPaste()) {
            \printf("\e[?2004h"); // Enable bracketed paste
        }

        $line = $this->readline->readline($this->getPrompt());

        if ($bracketedPaste) {
            \printf("\e[?2004l"); // ... and disable it again
        }

        return $line;
    }
protected function readline ( ) { if ( ! empty ( $ this -> inputBuffer ) ) { $ line = \ array_shift ( $ this -> inputBuffer ) ; if ( ! $ line instanceof SilentInput ) { $ this -> output -> writeln ( \ sprintf ( '<aside>%s %s</aside>' , static :: REPLAY , OutputFormatter :: escape ( $ line ) ) ) ; } return $ line ; } if ( $ bracketedPaste = $ this -> config -> useBracketedPaste ( ) ) { \ printf ( "\e[?2004h" ) ; // Enable bracketed paste } $ line = $ this -> readline -> readline ( $ this -> getPrompt ( ) ) ; if ( $ bracketedPaste ) { \ printf ( "\e[?2004l" ) ; // ... and disable it again } return $ line ; }
Read a line of user input.

This will return a line from the input buffer (if any exist). Otherwise,
it will ask the user for input.

If readline is enabled, this delegates to readline. Otherwise, it's an
ugly `fgets` call.

@return string One line of user input
Read a line of user input .