Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function getConnection($name = null) |
||
22 | { |
||
23 | $factory = $this->getContainer()->get($this->factories[$this->default]); |
||
24 | |||
25 | if (!is_null($name) && array_key_exists($name, $this->factories)) { |
||
26 | $factory = $this->getContainer()->get( |
||
27 | $this->factories[$name] |
||
28 | ); |
||
29 | } |
||
30 | |||
31 | if (!$factory instanceof ConnectionFactory) { |
||
32 | throw new NotFoundAMQPConnectionFactoryException(sprintf('%s: connection not found.', $name)); |
||
33 | } |
||
34 | |||
35 | return $factory->createConnection(); |
||
36 | } |
||
37 | |||
62 |