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

Breadcrumb

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

class AttributesRequestMatcher

Checks the Request attributes matches all regular expressions.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Symfony\Component\HttpFoundation\RequestMatcher\AttributesRequestMatcher implements \Symfony\Component\HttpFoundation\RequestMatcherInterface

Expanded class hierarchy of AttributesRequestMatcher

File

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

Namespace

Symfony\Component\HttpFoundation\RequestMatcher
View source
class AttributesRequestMatcher implements RequestMatcherInterface {
    
    /**
     * @param array<string, string> $regexps
     */
    public function __construct(array $regexps) {
    }
    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;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
AttributesRequestMatcher::matches public function Decides whether the rule(s) implemented by the strategy matches the supplied request. Overrides RequestMatcherInterface::matches
AttributesRequestMatcher::__construct public function

API Navigation

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