Conditions | 5 |
Paths | 7 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
30 | public function getHelper(ProxyInterface $proxy) |
||
31 | { |
||
32 | $serviceName = $proxy->getServiceName(); |
||
33 | |||
34 | if (!isset($this->databaseContainer[$serviceName])) { |
||
35 | foreach ($proxy->getServiceNamespaces('QueryContainer') as $class) { |
||
36 | if (class_exists($class)) { |
||
37 | $this->databaseContainer[$serviceName] = new $class(); |
||
38 | break; |
||
39 | } |
||
40 | } |
||
41 | |||
42 | if ($this->databaseContainer[$serviceName] === null) { |
||
43 | $this->databaseContainer[$serviceName] = new EmptyQueryContainer(); |
||
44 | } |
||
45 | } |
||
46 | |||
47 | return $this->databaseContainer[$serviceName]; |
||
48 | } |
||
49 | } |