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

Breadcrumb

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

function ServerRequestCreator::getMethodFromEnv

2 calls to ServerRequestCreator::getMethodFromEnv()
ServerRequestCreator::fromArrays in vendor/nyholm/psr7-server/src/ServerRequestCreator.php
Create a new server request from a set of arrays.
ServerRequestCreator::fromGlobals in vendor/nyholm/psr7-server/src/ServerRequestCreator.php
Create a new server request from the current environment variables. Defaults to a GET request to minimise the risk of an \InvalidArgumentException. Includes the current request headers as supplied by the server through `getallheaders()`. If…

File

vendor/nyholm/psr7-server/src/ServerRequestCreator.php, line 152

Class

ServerRequestCreator
@author Tobias Nyholm <tobias.nyholm@gmail.com> @author Martijn van der Ven <martijn@vanderven.se>

Namespace

Nyholm\Psr7Server

Code

private function getMethodFromEnv(array $environment) : string {
    if (false === isset($environment['REQUEST_METHOD'])) {
        throw new \InvalidArgumentException('Cannot determine HTTP method');
    }
    return $environment['REQUEST_METHOD'];
}

API Navigation

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