protected static function parseClass($class)
    {
        static $cache = array();

        if (array_key_exists($class, $cache) === false) {
            // Make reference for original input
            $string = $class;

            if ($string[0] === '\\') {
                $string = substr($string, 1);
            }

            if (preg_match('/^(?<namespace>.*)\\\\(?<className>.+?)$/', $string, $matches)) {
                $cache[$class] = array($matches['namespace'], $matches['className']);
            } else {
                $cache[$class] = array(null, $class);
            }
        }

        return $cache[$class];
    }
protected static function parseClass($class)
    {
        static $cache = array();

        if (array_key_exists($class, $cache) === false) {
            // Make reference for original input
            $string = $class;

            if ($string[0] === '\\') {
                $string = substr($string, 1);
            }

            if (preg_match('/^(?<namespace>.*)\\\\(?<className>.+?)$/', $string, $matches)) {
                $cache[$class] = array($matches['namespace'], $matches['className']);
            } else {
                $cache[$class] = array(null, $class);
            }
        }

        return $cache[$class];
    }
protected static function parseClass ( $ class ) { static $ cache = array ( ) ; if ( array_key_exists ( $ class , $ cache ) === false ) { // Make reference for original input $ string = $ class ; if ( $ string [ 0 ] === '\\' ) { $ string = substr ( $ string , 1 ) ; } if ( preg_match ( '/^(?<namespace>.*)\\\\(?<className>.+?)$/' , $ string , $ matches ) ) { $ cache [ $ class ] = array ( $ matches [ 'namespace' ] , $ matches [ 'className' ] ) ; } else { $ cache [ $ class ] = array ( null , $ class ) ; } } return $ cache [ $ class ] ; }
Parse the class to a namespace and className part

@param  string $class

@return array    array(<namespace>, <className>)
Parse the class to a namespace and className part