@@ -91,16 +91,16 @@ |
||
| 91 | 91 | private function getCheckOptions(InputInterface $input) : Options |
| 92 | 92 | { |
| 93 | 93 | $fileName = $input->getOption('config-file'); |
| 94 | - if(!$fileName) { |
|
| 94 | + if (!$fileName) { |
|
| 95 | 95 | return new Options(); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if(!is_readable($fileName)) { |
|
| 98 | + if (!is_readable($fileName)) { |
|
| 99 | 99 | throw new \InvalidArgumentException('unable to read ' . $fileName); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $jsonData = json_decode(file_get_contents($fileName), true); |
| 103 | - if(false === $jsonData) { |
|
| 103 | + if (false === $jsonData) { |
|
| 104 | 104 | throw new \Exception('error parsing the config file: ' . json_last_error_msg()); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | public function __construct(array $options = []) |
| 19 | 19 | { |
| 20 | 20 | foreach ($options as $key => $option) { |
| 21 | - $methodName = 'set'.$this->getCamelCase($key); |
|
| 22 | - if(!method_exists($this, $methodName)) { |
|
| 21 | + $methodName = 'set' . $this->getCamelCase($key); |
|
| 22 | + if (!method_exists($this, $methodName)) { |
|
| 23 | 23 | throw new \InvalidArgumentException($key . ' is not a known option - there is no method ' . $methodName); |
| 24 | 24 | } |
| 25 | 25 | $this->$methodName($option); |