Neuron-PHP

StreamInterface

Interface for input/output stream abstraction.

Provides a testable abstraction over STDIN/STDOUT for interactive CLI operations. Implementations can be real streams for production or mock streams for testing.

Table of Contents

Methods

isInteractive()  : bool
Check if the stream is connected to an interactive terminal
read()  : string|false
Read a line from the input stream
write()  : void
Write data to the output stream

Methods

isInteractive()

Check if the stream is connected to an interactive terminal

public isInteractive() : bool
Return values
bool

True if interactive (TTY), false otherwise

read()

Read a line from the input stream

public read() : string|false
Return values
string|false

Returns the read line or false on EOF

write()

Write data to the output stream

public write(string $data) : void
Parameters
$data : string

Data to write


        
On this page

Search results