PHP Class Clue\React\Buzz\Message\MessageFactory

Afficher le fichier Open project: clue/buzz-react Class Usage Examples

Méthodes publiques

Méthode Description
body ( React\Stream\ReadableStreamInterface | string $body ) : StreamInterface Creates a new instance of StreamInterface for the given body contents
expandBase ( Psr\Http\Message\UriInterface $uri, Psr\Http\Message\UriInterface $base ) : Psr\Http\Message\UriInterface Resolves the given relative or absolute $uri by appending it behind $this base URI
request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $headers = [], string | React\Stream\ReadableStreamInterface $content = '' ) : RequestInterface Creates a new instance of RequestInterface for the given request parameters
response ( string $version, integer $status, string $reason, array $headers = [], React\Stream\ReadableStreamInterface | string $body = '' ) : ResponseInterface Creates a new instance of ResponseInterface for the given response parameters
uri ( Psr\Http\Message\UriInterface | string $uri ) : Psr\Http\Message\UriInterface Creates a new instance of UriInterface for the given URI string or instance
uriRelative ( Psr\Http\Message\UriInterface $base, string $uri ) : Psr\Http\Message\UriInterface Creates a new instance of UriInterface for the given URI string relative to the given base URI

Method Details

body() public méthode

Creates a new instance of StreamInterface for the given body contents
public body ( React\Stream\ReadableStreamInterface | string $body ) : StreamInterface
$body React\Stream\ReadableStreamInterface | string
Résultat StreamInterface

expandBase() public méthode

The given $uri parameter can be either a relative or absolute URI and as such can not contain any URI template placeholders. As such, the outcome of this method represents a valid, absolute URI which will be returned as an instance implementing UriInterface. If the given $uri is a relative URI, it will simply be appended behind $base URI. If the given $uri is an absolute URI, it will simply be verified to be *below* the given $base URI.
See also: Browser::resolve()
public expandBase ( Psr\Http\Message\UriInterface $uri, Psr\Http\Message\UriInterface $base ) : Psr\Http\Message\UriInterface
$uri Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface
Résultat Psr\Http\Message\UriInterface

request() public méthode

Creates a new instance of RequestInterface for the given request parameters
public request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $headers = [], string | React\Stream\ReadableStreamInterface $content = '' ) : RequestInterface
$method string
$uri string | Psr\Http\Message\UriInterface
$headers array
$content string | React\Stream\ReadableStreamInterface
Résultat RequestInterface

response() public méthode

Creates a new instance of ResponseInterface for the given response parameters
public response ( string $version, integer $status, string $reason, array $headers = [], React\Stream\ReadableStreamInterface | string $body = '' ) : ResponseInterface
$version string
$status integer
$reason string
$headers array
$body React\Stream\ReadableStreamInterface | string
Résultat ResponseInterface

uri() public méthode

Creates a new instance of UriInterface for the given URI string or instance
public uri ( Psr\Http\Message\UriInterface | string $uri ) : Psr\Http\Message\UriInterface
$uri Psr\Http\Message\UriInterface | string
Résultat Psr\Http\Message\UriInterface

uriRelative() public méthode

Creates a new instance of UriInterface for the given URI string relative to the given base URI
public uriRelative ( Psr\Http\Message\UriInterface $base, string $uri ) : Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface
$uri string
Résultat Psr\Http\Message\UriInterface