Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | public static function create($connection) |
||
25 | { |
||
26 | $uri = new Uri($connection); |
||
27 | |||
28 | if (!isset(self::$config[$uri->getScheme()])) { |
||
29 | throw new \Exception('Protocol not found/registered!'); |
||
30 | } |
||
31 | |||
32 | $class = self::$config[$uri->getScheme()]; |
||
33 | |||
34 | return new $class($uri); |
||
35 | } |
||
36 | } |
||
37 |