| Conditions | 6 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 6.5625 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 5 | public function validateArguments($options) |
|
| 13 | { |
||
| 14 | 5 | $required = []; |
|
| 15 | 5 | foreach($options as $option) { |
|
| 16 | 5 | if(isset($option['required']) && $option['required'] && !isset($parsed[$option['name']])) { |
|
|
|
|||
| 17 | 5 | $required[] = $option['name']; |
|
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | 5 | if(!empty(($required))) { |
|
| 22 | throw new InvalidArgumentException( |
||
| 23 | sprintf("The following options are required: %s. Pass the --help option for more information about possible options.", implode(", $required")) |
||
| 24 | ); |
||
| 57 | } |