private function _fixResultKeys($result)
    {
        if (!$this->_case || $this->_case === \PDO::CASE_NATURAL) {
            return $result;
        }

        switch($this->_case)
        {
        case \PDO::CASE_LOWER:
            $case = CASE_LOWER;
            break;
        case \PDO::CASE_UPPER:
            $case = CASE_UPPER;
            break;
        default:
            throw new \PDOException('Unknown case attribute: '.$this->_case);
        }

        return array_map(
            function ($item) use ($case) {
                if (is_array($item)) {
                    $item = array_change_key_case($item, $case);
                }
                return $item;
            }, array_change_key_case($result, $case)
        );
    }
private function _fixResultKeys($result)
    {
        if (!$this->_case || $this->_case === \PDO::CASE_NATURAL) {
            return $result;
        }

        switch($this->_case)
        {
        case \PDO::CASE_LOWER:
            $case = CASE_LOWER;
            break;
        case \PDO::CASE_UPPER:
            $case = CASE_UPPER;
            break;
        default:
            throw new \PDOException('Unknown case attribute: '.$this->_case);
        }

        return array_map(
            function ($item) use ($case) {
                if (is_array($item)) {
                    $item = array_change_key_case($item, $case);
                }
                return $item;
            }, array_change_key_case($result, $case)
        );
    }
private function _fixResultKeys ( $ result ) { if ( ! $ this -> _case || $ this -> _case === \ PDO :: CASE_NATURAL ) { return $ result ; } switch ( $ this -> _case ) { case \ PDO :: CASE_LOWER : $ case = CASE_LOWER ; break ; case \ PDO :: CASE_UPPER : $ case = CASE_UPPER ; break ; default : throw new \ PDOException ( 'Unknown case attribute: ' . $ this -> _case ) ; } return array_map ( function ( $ item ) use ( $ case ) { if ( is_array ( $ item ) ) { $ item = array_change_key_case ( $ item , $ case ) ; } return $ item ; } , array_change_key_case ( $ result , $ case ) ) ; }
Fix the result keys

If natural, there's no need to do something. Otherwise, change to lower
or upper case

@param mixed $result data result

@return mixed $result with the keys fixed
Fix the result keys