File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,31 @@ This type of discovery finds a factory for a PSR-17_ implementation::
196196 }
197197 }
198198
199+ PSR-17 Factory
200+ --------------
201+
202+ The package also provides an ``Http\Discovery\Psr17Factory `` class that can be instantiated
203+ to get a generic PSR-17 factory::
204+
205+ use Http\Discovery\Psr17Factory;
206+
207+ $factory = new Psr17Factory();
208+
209+ // use any PSR-17 methods, e.g.
210+ $request = $factory->createRequest();
211+
212+ Internally, this class relies on the concrete PSR-17 factories that are installed in your project
213+ and can use discovery to find implementations if you do not specify them in the constructor.
214+
215+ ``Psr17Factory `` provides two additional methods that allow creating
216+ server requests or URI objects from the PHP super-globals::
217+
218+ $serverRequest = $factory->createServerRequestFromGlobals();
219+ $uri = $factory->createUriFromGlobals();
220+
221+ .. versionadded :: 1.15
222+ The ``Psr17Factory `` class is available since version 1.15.
223+
199224PSR-18 Client Discovery
200225-----------------------
201226
You can’t perform that action at this time.
0 commit comments