Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AttributesRequestMatcher.php

function AttributesRequestMatcher::matches

Overrides RequestMatcherInterface::matches

File

vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php, line 31

Class

AttributesRequestMatcher
Checks the Request attributes matches all regular expressions.

Namespace

Symfony\Component\HttpFoundation\RequestMatcher

Code

public function matches(Request $request) : bool {
    foreach ($this->regexps as $key => $regexp) {
        $attribute = $request->attributes
            ->get($key);
        if (!\is_string($attribute)) {
            return false;
        }
        if (!preg_match('{' . $regexp . '}', $attribute)) {
            return false;
        }
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal