Conditions | 3 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
23 | 49 | public static function register(Connection $connection, string $name = 'default'): void |
|
24 | { |
||
25 | 49 | if (!self::hasDefault()) { |
|
26 | 49 | self::$defaultConnection = $connection; |
|
27 | } |
||
28 | |||
29 | 49 | if (self::has($name)) { |
|
30 | throw StorageException::forAlreadyExistingConnection($name); |
||
31 | } |
||
32 | |||
33 | 49 | self::$connections[$name] = $connection; |
|
34 | 49 | } |
|
63 |