file-fetcher
Public Member Functions | Public Attributes | List of all members
SebastianBergmann\Environment\Console Class Reference

Public Member Functions

 hasColorSupport ()
 
 getNumberOfColumns ()
 
 isInteractive ($fileDescriptor=self::STDOUT)
 

Public Attributes

const STDIN = 0
 
const STDOUT = 1
 
const STDERR = 2
 

Member Function Documentation

◆ getNumberOfColumns()

SebastianBergmann\Environment\Console::getNumberOfColumns ( )

Returns the number of columns of the terminal.

@codeCoverageIgnore

◆ hasColorSupport()

SebastianBergmann\Environment\Console::hasColorSupport ( )

Returns true if STDOUT supports colorization.

This code has been copied and adapted from Symfony\Component\Console\Output\StreamOutput.

◆ isInteractive()

SebastianBergmann\Environment\Console::isInteractive (   $fileDescriptor = self::STDOUT)

Returns if the file descriptor is an interactive terminal or not.

Normally, we want to use a resource as a parameter, yet sadly it's not always awailable, eg when running code in interactive console (php -a), STDIN/STDOUT/STDERR constants are not defined.

Parameters
int | resource$fileDescriptor

Member Data Documentation

◆ STDERR

const SebastianBergmann\Environment\Console::STDERR = 2

◆ STDIN

const SebastianBergmann\Environment\Console::STDIN = 0

◆ STDOUT

const SebastianBergmann\Environment\Console::STDOUT = 1

The documentation for this class was generated from the following file: