| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 2 | public static function create($connection) |
|
| 37 | { |
||
| 38 | 2 | $uri = new Uri($connection); |
|
| 39 | |||
| 40 | 2 | if (!isset(self::$config[$uri->getScheme()])) { |
|
| 41 | 1 | throw new ProtocolNotRegisteredException('Protocol not found/registered!'); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | $class = self::$config[$uri->getScheme()]; |
|
| 45 | |||
| 46 | 1 | return new $class($uri); |
|
| 47 | } |
||
| 48 | } |
||
| 49 |