protected function getDimensionsFromMode() : ?array
    {
        if (empty($output = $this->execute('mode CON'))) {
            return null;
        }

        if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $output, $matches)) {
            return [
                'width' => (int) $matches[2],
                'height'=> (int) $matches[1]
            ];
        }

        return null;
    }
protected function getDimensionsFromMode() : ?array
    {
        if (empty($output = $this->execute('mode CON'))) {
            return null;
        }

        if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $output, $matches)) {
            return [
                'width' => (int) $matches[2],
                'height'=> (int) $matches[1]
            ];
        }

        return null;
    }
protected function getDimensionsFromMode ( ) : ? array { if ( empty ( $ output = $ this -> execute ( 'mode CON' ) ) ) { return null ; } if ( preg_match ( '/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/' , $ output , $ matches ) ) { return [ 'width' => ( int ) $ matches [ 2 ] , 'height' => ( int ) $ matches [ 1 ] ] ; } return null ; }
Attempts to determine the Terminal's dimensions based on the result of a 'mode CON' system call.

@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 result of a mode CON system call .