PHP Class VCR\Util\StreamHelper

Show file Open project: php-vcr/php-vcr Class Usage Examples

Public Methods

Method Description
createRequestFromStreamContext ( resource $context, string $path, Request $existing = null ) : Request Returns a Request from specified stream context and path.

Protected Methods

Method Description
getHttpOptionsFromContext ( $context ) : array Returns HTTP options from current stream context.

Method Details

createRequestFromStreamContext() public static method

If an existing Request is given, the stream context options are set on the specified Request object.
public static createRequestFromStreamContext ( resource $context, string $path, Request $existing = null ) : Request
$context resource Stream context resource.
$path string Path to use as url.
$existing VCR\Request Optional, existing request.
return VCR\Request

getHttpOptionsFromContext() protected static method

Returns HTTP options from current stream context.
See also: http://php.net/manual/en/context.http.php
protected static getHttpOptionsFromContext ( $context ) : array
return array HTTP options.