@@ -146,8 +146,7 @@ discard block |
||
146 | 146 | $index = $this->map[$key]; |
147 | 147 | |
148 | 148 | return $this->parameters[$index]; |
149 | - } |
|
150 | - else |
|
149 | + } else |
|
151 | 150 | { |
152 | 151 | throw new ArghException('Parameter \'' . $key . '\' not in collection'); |
153 | 152 | } |
@@ -198,9 +197,10 @@ discard block |
||
198 | 197 | $this->map[$param->getName()] = count($this->parameters)-1; |
199 | 198 | |
200 | 199 | // Map the new parameter's 'flag' to its corresponding index in the $parameters array |
201 | - if(!empty($param->getFlag())) $this->map[$param->getFlag()] = count($this->parameters)-1; |
|
202 | - } |
|
203 | - else |
|
200 | + if(!empty($param->getFlag())) { |
|
201 | + $this->map[$param->getFlag()] = count($this->parameters)-1; |
|
202 | + } |
|
203 | + } else |
|
204 | 204 | { |
205 | 205 | throw(new ArghException(__CLASS__ . ': Parameter \'' . $param->getName() . '\' cannot be redefined.')); |
206 | 206 | } |
@@ -232,22 +232,19 @@ discard block |
||
232 | 232 | { |
233 | 233 | // Call VariableParameters::addValue() method |
234 | 234 | $this->parameters[$this->map[$a->getKey()]]->addValue($a->getValue()); |
235 | - } |
|
236 | - else if( null !== $this->parameters[$this->map[$a->getKey()]]->getValue() ) |
|
235 | + } else if( null !== $this->parameters[$this->map[$a->getKey()]]->getValue() ) |
|
237 | 236 | { |
238 | 237 | // |
239 | 238 | // Do NOT allow a Parameter's value to be redefined |
240 | 239 | // |
241 | 240 | |
242 | 241 | throw(new ArghException(__CLASS__ . ': Parameter \'' . $a->getKey() . '\' value cannot be redefined.')); |
243 | - } |
|
244 | - else |
|
242 | + } else |
|
245 | 243 | { |
246 | 244 | // Set Parameter value |
247 | 245 | $this->parameters[$this->map[$a->getKey()]]->setValue($a->getValue()); |
248 | 246 | } |
249 | - } |
|
250 | - else |
|
247 | + } else |
|
251 | 248 | { |
252 | 249 | throw(new ArghException(__CLASS__ . ': Cannot merge Argument \'' . $a->getKey() . '\'. Parameter not defined.')); |
253 | 250 | } |
@@ -253,8 +253,7 @@ |
||
253 | 253 | { |
254 | 254 | // Create an array of Rules |
255 | 255 | $this->rules = array(); |
256 | - } |
|
257 | - catch(\Exception $e) |
|
256 | + } catch(\Exception $e) |
|
258 | 257 | { |
259 | 258 | throw($e); |
260 | 259 | } |