public function filterMatch($patterns)
    {
        $patterns = is_string($patterns) ? [$patterns] : $patterns;

        // String pattern is assumed to be path.
        foreach ($patterns as $key => $pattern) {
            if (is_string($pattern)) {
                $patterns[$key] = ['path' => $pattern];
            }
        }

        return $this->filter(function ($route) use ($patterns) {
            // If any of patterns matches - route passes.
            foreach ($patterns as $pattern) {
                if ($this->isRouteMatchesPattern($route, $pattern)) {
                    return true;
                }
            }

            // If all patterns don't match - route is filtered out.
            return false;
        });
    }
public function filterMatch($patterns)
    {
        $patterns = is_string($patterns) ? [$patterns] : $patterns;

        // String pattern is assumed to be path.
        foreach ($patterns as $key => $pattern) {
            if (is_string($pattern)) {
                $patterns[$key] = ['path' => $pattern];
            }
        }

        return $this->filter(function ($route) use ($patterns) {
            // If any of patterns matches - route passes.
            foreach ($patterns as $pattern) {
                if ($this->isRouteMatchesPattern($route, $pattern)) {
                    return true;
                }
            }

            // If all patterns don't match - route is filtered out.
            return false;
        });
    }
public function filterMatch ( $ patterns ) { $ patterns = is_string ( $ patterns ) ? [ $ patterns ] : $ patterns ; // String pattern is assumed to be path. foreach ( $ patterns as $ key => $ pattern ) { if ( is_string ( $ pattern ) ) { $ patterns [ $ key ] = [ 'path' => $ pattern ] ; } } return $ this -> filter ( function ( $ route ) use ( $ patterns ) { // If any of patterns matches - route passes. foreach ( $ patterns as $ pattern ) { if ( $ this -> isRouteMatchesPattern ( $ route , $ pattern ) ) { return true ; } } // If all patterns don't match - route is filtered out. return false ; } ) ; }
Include routes that match patterns.

@param array <array|string> $patterns

@return static
Include routes that match patterns .