protected function outputFormat($data, $default = null)
    {
        switch ($this->getParam(array('f'), $default)) {
            case 'print-r':
                $this->line(print_r($data, true));
                break;
            case 'var-export':
                $this->line(var_export($data, true));
                break;
            case 'json':
                $this->line(json_encode($data, JSON_PRETTY_PRINT));
                break;
            case 'var-dump':
                ob_start();
                var_dump($data);
                $this->line(ob_get_clean());
                break;
            default:
                return null; // Pass to table formatter
        }

        $this->output();
    }
protected function outputFormat($data, $default = null)
    {
        switch ($this->getParam(array('f'), $default)) {
            case 'print-r':
                $this->line(print_r($data, true));
                break;
            case 'var-export':
                $this->line(var_export($data, true));
                break;
            case 'json':
                $this->line(json_encode($data, JSON_PRETTY_PRINT));
                break;
            case 'var-dump':
                ob_start();
                var_dump($data);
                $this->line(ob_get_clean());
                break;
            default:
                return null; // Pass to table formatter
        }

        $this->output();
    }
protected function outputFormat ( $ data , $ default = null ) { switch ( $ this -> getParam ( array ( 'f' ) , $ default ) ) { case 'print-r' : $ this -> line ( print_r ( $ data , true ) ) ; break ; case 'var-export' : $ this -> line ( var_export ( $ data , true ) ) ; break ; case 'json' : $ this -> line ( json_encode ( $ data , JSON_PRETTY_PRINT ) ) ; break ; case 'var-dump' : ob_start ( ) ; var_dump ( $ data ) ; $ this -> line ( ob_get_clean ( ) ) ; break ; default : return null ; // Pass to table formatter } $ this -> output ( ) ; }
Output formatted data
@param mixed $data
@param null|string $default
@return null
Output formatted data