protected function updateRowKeyLengths(array $data = [])
    {
        $lengths = array_map('mb_strlen', $data);

        $keys = array_merge(array_keys($lengths), array_keys($this->maxLengths));

        foreach ($keys as $key) {
            if (!isset($this->maxLengths[$key])
                || (isset($lengths[$key]) && $lengths[$key] > $this->maxLengths[$key])
            ) {
                $this->maxLengths[$key] = $lengths[$key];
            }
        }
    }
protected function updateRowKeyLengths(array $data = [])
    {
        $lengths = array_map('mb_strlen', $data);

        $keys = array_merge(array_keys($lengths), array_keys($this->maxLengths));

        foreach ($keys as $key) {
            if (!isset($this->maxLengths[$key])
                || (isset($lengths[$key]) && $lengths[$key] > $this->maxLengths[$key])
            ) {
                $this->maxLengths[$key] = $lengths[$key];
            }
        }
    }
protected function updateRowKeyLengths ( array $ data = [ ] ) { $ lengths = array_map ( 'mb_strlen' , $ data ) ; $ keys = array_merge ( array_keys ( $ lengths ) , array_keys ( $ this -> maxLengths ) ) ; foreach ( $ keys as $ key ) { if ( ! isset ( $ this -> maxLengths [ $ key ] ) || ( isset ( $ lengths [ $ key ] ) && $ lengths [ $ key ] > $ this -> maxLengths [ $ key ] ) ) { $ this -> maxLengths [ $ key ] = $ lengths [ $ key ] ; } } }
Parses the rows to determine the key lengths to make a pretty table

@param array $data
Parses the rows to determine the key lengths to make a pretty table