| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 52 | 9 | public function getAccount($key = null) |
|
| 53 | { |
||
| 54 | 9 | if (null === $key) { |
|
| 55 | 2 | $key = $this->defaultAccountKey; |
|
| 56 | } |
||
| 57 | |||
| 58 | 9 | if (!$this->hasAccount($key)) { |
|
| 59 | 3 | throw new \InvalidArgumentException('No account for key '.$key.' configured.'); |
|
| 60 | } |
||
| 61 | |||
| 62 | 6 | return $this->accounts[$key]; |
|
| 63 | } |
||
| 64 | |||
| 81 |