pas
Static Public Member Functions | List of all members
pas\stdin Class Reference

Static Public Member Functions

static init (?callable $line_function=null)
 
static getNextLine ()
 

Member Function Documentation

◆ getNextLine()

static pas\stdin::getNextLine ( )
static

Blocks until the user has submitted a line and then returns it.

Exceptions
BadMethodCallExceptionif pas\stdin was not initialized via pas\stdin::init()
Returns
string

◆ init()

static pas\stdin::init ( ?callable  $line_function = null)
static

Initializes pas's STDIN handling, if it wasn't already, enabling the "stdin_line" event and the stdin::getNextLine() function. After this, STDIN is in pas's hands, and there's no way out.

Parameters
callable | null$line_functionThe function to be called when the user has submitted a line.
Returns
void