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

Breadcrumb

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

function MethodRequestMatcher::__construct

Parameters

string[]|string $methods An HTTP method or an array of HTTP methods: Strings can contain a comma-delimited list of methods

File

vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php, line 33

Class

MethodRequestMatcher
Checks the HTTP method of a Request.

Namespace

Symfony\Component\HttpFoundation\RequestMatcher

Code

public function __construct(array|string $methods) {
    $this->methods = array_reduce(array_map('strtoupper', (array) $methods), static fn(array $methods, string $method) => array_merge($methods, preg_split('/\\s*,\\s*/', $method)), []);
}

API Navigation

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