Conditions | 2 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 14 |
Ratio | 100 % |
Tests | 3 |
CRAP Score | 2.9766 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | 1 | public static function find() |
|
20 | { |
||
21 | try { |
||
22 | 1 | $streamFactory = static::findOneByType('Http\Message\StreamFactory'); |
|
23 | |||
24 | 1 | return new $streamFactory(); |
|
25 | } catch (NotFoundException $e) { |
||
26 | throw new NotFoundException( |
||
27 | 'No factories found. Install php-http/message to use Guzzle or Diactoros factories.', |
||
28 | 0, |
||
29 | $e |
||
30 | ); |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 |