| Conditions | 2 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 14 |
| Ratio | 100 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 4 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 23 | 1 | public static function find() |
|
| 24 | { |
||
| 25 | try { |
||
| 26 | $messageFactory = static::findOneByType(MessageFactory::class); |
||
| 27 | |||
| 28 | 1 | return new $messageFactory(); |
|
| 29 | 1 | } catch (DiscoveryFailedException $e) { |
|
| 30 | 1 | throw new NotFoundException( |
|
| 31 | 1 | 'No message factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.', |
|
| 32 | 1 | 0, |
|
| 33 | $e |
||
| 34 | 1 | ); |
|
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 |