Documentation

Listener

Execution Loop Listener interface.

Table of Contents

afterLoop()  : mixed
Called at the end of each loop.
afterRun()  : mixed
Called once after the REPL session ends.
beforeLoop()  : mixed
Called at the start of each loop.
beforeRun()  : mixed
Called once before the REPL session starts.
isSupported()  : bool
Determines whether this listener should be active.
onExecute()  : string|null
Called before executing user code.
onInput()  : string|null
Called on user input.

Methods

afterLoop()

Called at the end of each loop.

public afterLoop(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

afterRun()

Called once after the REPL session ends.

public afterRun(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

beforeLoop()

Called at the start of each loop.

public beforeLoop(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

beforeRun()

Called once before the REPL session starts.

public beforeRun(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

isSupported()

Determines whether this listener should be active.

public static isSupported() : bool
Return values
bool

onExecute()

Called before executing user code.

public onExecute(Shell $shell, string $code) : string|null

Return a new string to override or rewrite user code.

Note that this is run after the Code Cleaner, so if you return invalid or unsafe PHP here, it'll be executed without any of the safety Code Cleaner provides. This comes with the big kid warranty :)

Parameters
$shell : Shell
$code : string
Return values
string|null

User code override

onInput()

Called on user input.

public onInput(Shell $shell, string $input) : string|null

Return a new string to override or rewrite user input.

Parameters
$shell : Shell
$input : string
Return values
string|null

User input override

Search results