Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.

php-http/message-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

HTTP Message Factory

Latest Version Software License Total Downloads

Factory interfaces for PSR-7 HTTP Message.

Install

Via Composer

$ composer require php-http/message-factory

Usage

This package provides interfaces for PSR-7 factories including:

  • MessageFactory - WIP
  • ServerRequestFactory - WIP
  • StreamFactory - WIP
  • UploadedFileFactory - WIP
  • UriFactory - WIP

A virtual package (php-http/message-factory-implementation) MAY be introduced which MUST be versioned together with this package.

General usage

use Http\Message\SomeFactory;

class MyFactory implements SomeFactory
{

}

Factory awares and helpers

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);

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact us at [email protected].

License

The MIT License (MIT). Please see License File for more information.

About

Abandoned: Httplug Factory interfaces for PSR-7 HTTP Message

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages