src/Charcoal/Model/Service/MetadataLoader.php
private function metaKeyFromClassName($class)
    {
        $key = trim($class, '\\');

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

        $ident = strtolower(preg_replace('/([a-z])([A-Z])/', '$1-$2', $class));
        $ident = str_replace('\\', '/', strtolower($ident));
        $ident = ltrim($ident, '/');

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

        return $ident;
    }
private function metaKeyFromClassName($class)
    {
        $key = trim($class, '\\');

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

        $ident = strtolower(preg_replace('/([a-z])([A-Z])/', '$1-$2', $class));
        $ident = str_replace('\\', '/', strtolower($ident));
        $ident = ltrim($ident, '/');

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

        return $ident;
    }
private function metaKeyFromClassName ( $ class ) { $ key = trim ( $ class , '\\' ) ; if ( isset ( static :: $ snakeCache [ $ key ] ) ) { return static :: $ snakeCache [ $ key ] ; } $ ident = strtolower ( preg_replace ( '/([a-z])([A-Z])/' , '$1-$2' , $ class ) ) ; $ ident = str_replace ( '\\' , '/' , strtolower ( $ ident ) ) ; $ ident = ltrim ( $ ident , '/' ) ; static :: $ snakeCache [ $ key ] = $ ident ; static :: $ camelCache [ $ ident ] = $ key ; return $ ident ; }
Convert a CamelCase namespace to kebab-case.

@param  string $class The FQCN to convert.
@return string Returns a kebab-cased namespace.
Convert a CamelCase namespace to kebab - case .