| Conditions | 6 |
| Paths | 5 |
| Total Lines | 18 |
| Lines | 18 |
| Ratio | 100 % |
| Tests | 10 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 6 | View Code Duplication | protected function validateConfig() |
| 30 | { |
||
| 31 | 6 | if (! isset($this->options['host'])) { |
|
| 32 | 1 | throw new UnexpectedValueException("Missing 'host' as option"); |
|
| 33 | } |
||
| 34 | |||
| 35 | 5 | if (! isset($this->options['port'])) { |
|
| 36 | 1 | throw new UnexpectedValueException("Missing 'port' as option"); |
|
| 37 | } |
||
| 38 | |||
| 39 | 4 | if (! isset($this->options['username'])) { |
|
| 40 | 1 | throw new UnexpectedValueException("Missing 'username' as option"); |
|
| 41 | } |
||
| 42 | |||
| 43 | 3 | if (! isset($this->options['password']) && ! isset($this->options['privateKey'])) { |
|
| 44 | 1 | throw new UnexpectedValueException("Missing either 'password' or 'privateKey' as option"); |
|
| 45 | } |
||
| 46 | 2 | } |
|
| 47 | } |
||
| 48 |