protected function formatKeyCase($input, $levels = null)
    {
        $caseFormat = APIBoilerplate::getResponseCaseType();

        if ($caseFormat == APIBoilerplate::CAMEL_CASE) {
            if (is_array($input)) {
                $transformed = camel_case_array_keys($input, $levels);
            } else {
                $transformed = camel_case($input);
            }
        } elseif ($caseFormat == APIBoilerplate::SNAKE_CASE) {
            if (is_array($input)) {
                $transformed = snake_case_array_keys($input, $levels);
            } else {
                $transformed = snake_case($input);
            }
        }

        return $transformed;
    }
protected function formatKeyCase($input, $levels = null)
    {
        $caseFormat = APIBoilerplate::getResponseCaseType();

        if ($caseFormat == APIBoilerplate::CAMEL_CASE) {
            if (is_array($input)) {
                $transformed = camel_case_array_keys($input, $levels);
            } else {
                $transformed = camel_case($input);
            }
        } elseif ($caseFormat == APIBoilerplate::SNAKE_CASE) {
            if (is_array($input)) {
                $transformed = snake_case_array_keys($input, $levels);
            } else {
                $transformed = snake_case($input);
            }
        }

        return $transformed;
    }
protected function formatKeyCase ( $ input , $ levels = null ) { $ caseFormat = APIBoilerplate :: getResponseCaseType ( ) ; if ( $ caseFormat == APIBoilerplate :: CAMEL_CASE ) { if ( is_array ( $ input ) ) { $ transformed = camel_case_array_keys ( $ input , $ levels ) ; } else { $ transformed = camel_case ( $ input ) ; } } elseif ( $ caseFormat == APIBoilerplate :: SNAKE_CASE ) { if ( is_array ( $ input ) ) { $ transformed = snake_case_array_keys ( $ input , $ levels ) ; } else { $ transformed = snake_case ( $ input ) ; } } return $ transformed ; }
Formats case of the input array or scalar to desired case

@param array|string $input
@param int|null $levels How many levels of an array keys to transform - by default recurse infiniately (null)
@return array $transformed
Formats case of the input array or scalar to desired case