ddrv / server-request-wizard
Helper for creating PSR-7 ServerRequest from global vars
Fund package maintenance!
Other
v2.0.0
2021-12-02 14:50 UTC
Requires
- php: >=7.1
- ext-mbstring: *
- psr/http-factory: ^1.0
Requires (Dev)
- nyholm/psr7: ^1.4
- squizlabs/php_codesniffer: ^3.5
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);