| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | 2 | public static function create($connection) |
|
| 43 | { |
||
| 44 | 2 | $uri = new Uri($connection); |
|
| 45 | |||
| 46 | 2 | if (!isset(self::$config[$uri->getScheme()])) { |
|
| 47 | 1 | throw new ProtocolNotRegisteredException('Protocol not found/registered!'); |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | $class = self::$config[$uri->getScheme()]; |
|
| 51 | |||
| 52 | 1 | return new $class($uri); |
|
| 53 | } |
||
| 55 |