public function extractClassNameFromUse(string $use)
    {
        $matches = [];

        if (preg_match(self::USE_CLASS_EXTRACT_REGEXP, $use, $matches) === 0) {
            throw new InvalidNamespaceException($use);
        }

        $className = $matches['classname'];
        $namespace = array_key_exists('namespace', $matches) ? $matches['namespace'] : '';

        if (substr($namespace, -1, 1) === '\\') {
            $namespace = substr($namespace, 0, -1);
        }

        return [
            $className,
            $namespace
        ];
    }
public function extractClassNameFromUse(string $use)
    {
        $matches = [];

        if (preg_match(self::USE_CLASS_EXTRACT_REGEXP, $use, $matches) === 0) {
            throw new InvalidNamespaceException($use);
        }

        $className = $matches['classname'];
        $namespace = array_key_exists('namespace', $matches) ? $matches['namespace'] : '';

        if (substr($namespace, -1, 1) === '\\') {
            $namespace = substr($namespace, 0, -1);
        }

        return [
            $className,
            $namespace
        ];
    }
public function extractClassNameFromUse ( string $ use ) { $ matches = [ ] ; if ( preg_match ( self :: USE_CLASS_EXTRACT_REGEXP , $ use , $ matches ) === 0 ) { throw new InvalidNamespaceException ( $ use ) ; } $ className = $ matches [ 'classname' ] ; $ namespace = array_key_exists ( 'namespace' , $ matches ) ? $ matches [ 'namespace' ] : '' ; if ( substr ( $ namespace , - 1 , 1 ) === '\\' ) { $ namespace = substr ( $ namespace , 0 , - 1 ) ; } return [ $ className , $ namespace ] ; }
Extracts the class name from a used namespaced class

@param string $use

@return mixed

@throws InvalidNamespaceException
Extracts the class name from a used namespaced class