Skip to content

TestRequest

OAuth2\Request This class is taken from the Symfony2 Framework and is part of the Symfony package.

Properties

query

public $query

request

public $request

server

public $server

headers

public $headers

Methods

__construct

Constructor.

public __construct(): mixed

query

public query(mixed $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name mixed
$default mixed

request

public request(mixed $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name mixed
$default mixed

server

public server(mixed $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name mixed
$default mixed

getAllQueryParameters

public getAllQueryParameters(): array

setQuery

public setQuery(array $query): mixed

Parameters:

Parameter Type Description
$query array

setMethod

public setMethod(mixed $method): mixed

Parameters:

Parameter Type Description
$method mixed

setPost

public setPost(array $params): mixed

Parameters:

Parameter Type Description
$params array

createPost

public static createPost(array $params = array()): mixed
  • This method is static.

Parameters:

Parameter Type Description
$params array

Inherited methods

__construct

Constructor.

public __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string $content = null, array $headers = null): mixed

Parameters:

Parameter Type Description
$query array - The GET parameters
$request array - The POST parameters
$attributes array - The request attributes (parameters parsed from the PATH_INFO, ...)
$cookies array - The COOKIE parameters
$files array - The FILES parameters
$server array - The SERVER parameters
$content string - The raw body data
$headers array - The headers

initialize

Sets the parameters for this request.

public initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string $content = null, array $headers = null): mixed

This method also re-initializes all properties.

Parameters:

Parameter Type Description
$query array - The GET parameters
$request array - The POST parameters
$attributes array - The request attributes (parameters parsed from the PATH_INFO, ...)
$cookies array - The COOKIE parameters
$files array - The FILES parameters
$server array - The SERVER parameters
$content string - The raw body data
$headers array - The headers

query

public query(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed

request

public request(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed

server

public server(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed

headers

public headers(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed

getAllQueryParameters

public getAllQueryParameters(): array

getContent

Returns the request body content.

public getContent(bool $asResource = false): string|resource

Parameters:

Parameter Type Description
$asResource bool - If true, a resource will be returned

Return Value:

  • The request body content or a resource to read the body stream.

Throws:


getHeadersFromServer

private getHeadersFromServer(array $server): array

Parameters:

Parameter Type Description
$server array

createFromGlobals

Creates a new request with values from PHP's super globals.

public static createFromGlobals(): \OAuth2\Request
  • This method is static.

Return Value:

  • A new request


Automatically generated on 2025-03-18