PluginProbe
DecaLog / 4.4.0
DecaLog v4.4.0
3.0.2 3.1.0 3.10.0 3.2.0 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 3.7.1 3.8.0 3.9.0 3.9.1 4.0.0 4.1.0 4.2.0 4.3.0 4.3.1 4.4.0 4.5.0 All 75 releases
decalog / includes / libraries / http / discovery / StreamFactoryDiscovery.php

StreamFactoryDiscovery.php in DecaLog 4.4.0, at includes/libraries/http/discovery/StreamFactoryDiscovery.php

36 lines 960 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Http\Discovery;
4
5 use Http\Discovery\Exception\DiscoveryFailedException;
6 use Http\Message\StreamFactory;
7
8 /**
9 * Finds a Stream Factory.
10 *
11 * @author Ми�
12 аил Красильников <m.krasilnikov@yandex.ru>
13 *
14 * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery.
15 */
16 final class StreamFactoryDiscovery extends ClassDiscovery
17 {
18 /**
19 * Finds a Stream Factory.
20 *
21 * @return StreamFactory
22 *
23 * @throws Exception\NotFoundException
24 */
25 public static function find()
26 {
27 try {
28 $streamFactory = static::findOneByType(StreamFactory::class);
29 } catch (DiscoveryFailedException $e) {
30 throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e);
31 }
32
33 return static::instantiateClass($streamFactory);
34 }
35 }
36