ddrv/server-request-wizard

Helper for creating PSR-7 ServerRequest from global vars

v2.0.0 2021-12-02 14:50 UTC

This package is auto-updated.

Last update: 2024-10-29 05:53:55 UTC


README

Install

composer require ddrv/server-request-wizard:^1.0

Usage

<?php

/**
 * @var Psr\Http\Message\ServerRequestFactoryInterface $serverRequestFactory
 * @var Psr\Http\Message\StreamFactoryInterface $streamFactory
 * @var Psr\Http\Message\UploadedFileFactoryInterface $UploadedFileFactory
 */

$wizard = new Ddrv\ServerRequestWizard\ServerRequestWizard($serverRequestFactory, $streamFactory, $UploadedFileFactory);

$request = $wizard->create($_GET, $_POST, $_SERVER, $_COOKIE, $_FILES);