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

Breadcrumb

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

function HeaderRequestMatcher::matches

Overrides RequestMatcherInterface::matches

File

vendor/symfony/http-foundation/RequestMatcher/HeaderRequestMatcher.php, line 38

Class

HeaderRequestMatcher
Checks the presence of HTTP headers in a Request.

Namespace

Symfony\Component\HttpFoundation\RequestMatcher

Code

public function matches(Request $request) : bool {
    if (!$this->headers) {
        return true;
    }
    foreach ($this->headers as $header) {
        if (!$request->headers
            ->has($header)) {
            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