Cascade\Config\Loader\ClassLoader::optionsToCamelCase PHP Method

optionsToCamelCase() public static method

Return option values indexed by name using camelCased keys
public static optionsToCamelCase ( array $options ) : mixed[]
$options array Array of options
return mixed[] Array of options indexed by (camelCased) name
    public static function optionsToCamelCase(array $options)
    {
        $optionsByName = array();
        if (count($options)) {
            foreach ($options as $name => $value) {
                $optionsByName[Util::snakeToCamelCase($name)] = $value;
            }
        }
        return $optionsByName;
    }

Usage Example

 public function testOptionsToCamelCase()
 {
     $array = array('hello_there' => 'Hello', 'bye_bye' => 'Bye');
     $this->assertEquals(array('helloThere' => 'Hello', 'byeBye' => 'Bye'), ClassLoader::optionsToCamelCase($array));
 }