private function getRegexp(array $patterns): string
    {
        $regexps = [];
        foreach ($patterns as $pattern) {
            // Escape namespace
            $regex = preg_quote(ltrim($pattern, '\\'));

            // Wildcards * and **
            $regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']);

            // If this class does not end by a slash, anchor the end
            if ('\\' !== substr($regex, -1)) {
                $regex .= '$';
            }

            $regexps[] = '^'.$regex;
        }

        return sprintf('{%s}', implode('|', $regexps));
    }
private function getRegexp(array $patterns): string
    {
        $regexps = [];
        foreach ($patterns as $pattern) {
            // Escape namespace
            $regex = preg_quote(ltrim($pattern, '\\'));

            // Wildcards * and **
            $regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']);

            // If this class does not end by a slash, anchor the end
            if ('\\' !== substr($regex, -1)) {
                $regex .= '$';
            }

            $regexps[] = '^'.$regex;
        }

        return sprintf('{%s}', implode('|', $regexps));
    }
private function getRegexp ( array $ patterns ) : string { $ regexps = [ ] ; foreach ( $ patterns as $ pattern ) { // Escape namespace $ regex = preg_quote ( ltrim ( $ pattern , '\\' ) ) ; // Wildcards * and ** $ regex = strtr ( $ regex , [ '\\*\\*' => '.*?' , '\\*' => '[^\\\\]*?' ] ) ; // If this class does not end by a slash, anchor the end if ( '\\' !== substr ( $ regex , - 1 ) ) { $ regex .= '$' ; } $ regexps [ ] = '^' . $ regex ; } return sprintf ( '{%s}' , implode ( '|' , $ regexps ) ) ; }
Builds a regexp to check if a class is auto-mapped.
Builds a regexp to check if a class is auto - mapped .