Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 72 | public function getConnection(?string $name = null) : Connection |
|
38 | { |
||
39 | 72 | $name = $name ?? $this->defaultConnectionName; |
|
40 | |||
41 | 72 | if (! $this->container->has($name)) { |
|
42 | 24 | throw new InvalidArgumentException(sprintf('Connection with name "%s" does not exist.', $name)); |
|
43 | } |
||
44 | |||
45 | 48 | return $this->container->get($name); |
|
46 | } |
||
70 |