protected function getDimensionsFromAnsicon() : ?array
    {
        if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
            return [
                'width'  => (int) $matches[1],
                'height' => (int) ($matches[4] ?? $matches[2])
            ];
        }

        return null;
    }
protected function getDimensionsFromAnsicon() : ?array
    {
        if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
            return [
                'width'  => (int) $matches[1],
                'height' => (int) ($matches[4] ?? $matches[2])
            ];
        }

        return null;
    }
protected function getDimensionsFromAnsicon ( ) : ? array { if ( preg_match ( '/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/' , trim ( getenv ( 'ANSICON' ) ) , $ matches ) ) { return [ 'width' => ( int ) $ matches [ 1 ] , 'height' => ( int ) ( $ matches [ 4 ] ?? $ matches [ 2 ] ) ] ; } return null ; }
Attempts to determine the Terminal's dimensions based on the 'ANSICON' environmental variables.

@return  array   Either an array containing two keys - 'width' and 'height' or null if the data couldn't
be parsed to retrieve anything useful.
Attempts to determine the Terminal s dimensions based on the ANSICON environmental variables .