Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public function getConnection(string $name): Connection |
||
42 | { |
||
43 | try { |
||
44 | $connection = $this->connectionManager->getConnection($name); |
||
45 | } catch (DBALException $exception) { |
||
46 | throw new ConnectionNotFound("The connection '$name' is not found.", 0, $exception); |
||
47 | } |
||
48 | |||
49 | if (!$connection instanceof DoctrineConnection) { |
||
50 | throw new ConnectionNotFound("The connection '$name' is not a doctrine connection."); |
||
51 | } |
||
52 | |||
53 | return $connection; |
||
54 | } |
||
55 | } |