Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
50 | 9 | public function credentials() |
|
51 | { |
||
52 | 9 | $creds = $this->cloudEnvironment->serviceCredentials(); |
|
53 | |||
54 | 9 | if (!isset($creds['memcached_servers'])) { |
|
55 | 3 | throw new \OutOfBoundsException('Memcache credentials not found'); |
|
56 | } |
||
57 | |||
58 | 6 | $servers = array(); |
|
59 | 6 | foreach ($creds['memcached_servers'] as $id => $url) { |
|
60 | 6 | $data = parse_url($url); |
|
61 | 6 | $servers[$id] = new MemcacheCredentials($data); |
|
62 | 6 | } |
|
63 | |||
64 | 6 | return $servers; |
|
65 | } |
||
66 | } |
||
67 |