src/Charcoal/Model/Service/MetadataLoader.php
private function classNameFromMetaKey($ident)
    {
        $key = $ident;

        if (isset(static::$camelCache[$key])) {
            return static::$camelCache[$key];
        }

        // Change "foo-bar" to "fooBar"
        $parts = explode('-', $ident);
        array_walk(
            $parts,
            function(&$i) {
                $i = ucfirst($i);
            }
        );
        $ident = implode('', $parts);

        // Change "/foo/bar" to "\Foo\Bar"
        $classname = str_replace('/', '\\', $ident);
        $parts     = explode('\\', $classname);

        array_walk(
            $parts,
            function(&$i) {
                $i = ucfirst($i);
            }
        );

        $classname = trim(implode('\\', $parts), '\\');

        static::$camelCache[$key]       = $classname;
        static::$snakeCache[$classname] = $key;

        return $classname;
    }
private function classNameFromMetaKey($ident)
    {
        $key = $ident;

        if (isset(static::$camelCache[$key])) {
            return static::$camelCache[$key];
        }

        // Change "foo-bar" to "fooBar"
        $parts = explode('-', $ident);
        array_walk(
            $parts,
            function(&$i) {
                $i = ucfirst($i);
            }
        );
        $ident = implode('', $parts);

        // Change "/foo/bar" to "\Foo\Bar"
        $classname = str_replace('/', '\\', $ident);
        $parts     = explode('\\', $classname);

        array_walk(
            $parts,
            function(&$i) {
                $i = ucfirst($i);
            }
        );

        $classname = trim(implode('\\', $parts), '\\');

        static::$camelCache[$key]       = $classname;
        static::$snakeCache[$classname] = $key;

        return $classname;
    }
private function classNameFromMetaKey ( $ ident ) { $ key = $ ident ; if ( isset ( static :: $ camelCache [ $ key ] ) ) { return static :: $ camelCache [ $ key ] ; } // Change "foo-bar" to "fooBar" $ parts = explode ( '-' , $ ident ) ; array_walk ( $ parts , function ( & $ i ) { $ i = ucfirst ( $ i ) ; } ) ; $ ident = implode ( '' , $ parts ) ; // Change "/foo/bar" to "\Foo\Bar" $ classname = str_replace ( '/' , '\\' , $ ident ) ; $ parts = explode ( '\\' , $ classname ) ; array_walk ( $ parts , function ( & $ i ) { $ i = ucfirst ( $ i ) ; } ) ; $ classname = trim ( implode ( '\\' , $ parts ) , '\\' ) ; static :: $ camelCache [ $ key ] = $ classname ; static :: $ snakeCache [ $ classname ] = $ key ; return $ classname ; }
Convert a kebab-cased namespace to CamelCase.

@param  string $ident The metadata identifier to convert.
@return string Returns a valid PHP namespace.
Convert a kebab - cased namespace to CamelCase .