digphp/psr17

digphp psr17

1.0.0 2022-03-10 05:51 UTC

This package is auto-updated.

Last update: 2024-04-10 10:12:49 UTC


README

php psr17

Installation

composer require digphp/psr17

Usage

$factory = new \DigPHP\Psr17\Factory;

$request = $factory->createRequest(string $method, $uri);
$response = $factory->createResponse(int $code = 200, string $reasonPhrase = '');
$response = $factory->createGeneralResponse(int $code = 200, array $headers = [], string $body = null);
$server_request = $factory->createServerRequest(string $method, $uri, array $serverParams = []);
$stream = $factory->createStream(string $content = '');
$stream = $factory->createStreamFromFile(string $file, string $mode = 'r');
$stream = $factory->createStreamFromResource($resource);
$upload_file = $factory->createUploadedFile(StreamInterface $stream,int $size = null,int $error = \UPLOAD_ERR_OK,string $clientFilename = null,string $clientMediaType = null);
$uri = $factory->createUri(string $uri = '');