Factory interfaces for PSR-7 HTTP Message.
Via Composer
$ composer require php-http/message-factoryThis package provides interfaces for PSR-7 factories including:
MessageFactory- WIPServerRequestFactory- WIPStreamFactory- WIPUploadedFileFactory- WIPUriFactory- WIP
A virtual package (php-http/message-factory-implementation) MAY be introduced which MUST be versioned together with this package.
use Http\Message\SomeFactory;
class MyFactory implements SomeFactory
{
}For each factory there is a helper interface and trait to ease injecting them into other objects (such as HTTP clients).
An example:
use Http\Message\SomeFactoryAware;
use Http\Message\SomeFactoryHelper;
class HttpClient implements SomeFactoryAware
{
use SomeFactoryHelper;
}
$client = new HttpClient();
$someFactory = $client->getSomeFactory();
$client->setSomeFactory($someFactory);Please see CONTRIBUTING for details.
If you discover any security related issues, please contact us at [email protected].
The MIT License (MIT). Please see License File for more information.