Skip to content

Commit 7923f6c

Browse files
javiereguiluzfabpot
authored andcommitted
Standardize the name of the exception variables
1 parent cc478a4 commit 7923f6c

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

Definition/ArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ protected function finalizeValue($value)
256256

257257
try {
258258
$value[$name] = $child->finalize($value[$name]);
259-
} catch (UnsetKeyException $unset) {
259+
} catch (UnsetKeyException $e) {
260260
unset($value[$name]);
261261
}
262262
}

Definition/BaseNode.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,10 @@ final public function finalize($value)
302302
foreach ($this->finalValidationClosures as $closure) {
303303
try {
304304
$value = $closure($value);
305-
} catch (Exception $correctEx) {
306-
throw $correctEx;
307-
} catch (\Exception $invalid) {
308-
throw new InvalidConfigurationException(sprintf(
309-
'Invalid configuration for path "%s": %s',
310-
$this->getPath(),
311-
$invalid->getMessage()
312-
), $invalid->getCode(), $invalid);
305+
} catch (Exception $e) {
306+
throw $e;
307+
} catch (\Exception $e) {
308+
throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": %s', $this->getPath(), $e->getMessage()), $e->getCode(), $e);
313309
}
314310
}
315311

Definition/PrototypedArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ protected function finalizeValue($value)
211211
$this->prototype->setName($k);
212212
try {
213213
$value[$k] = $this->prototype->finalize($v);
214-
} catch (UnsetKeyException $unset) {
214+
} catch (UnsetKeyException $e) {
215215
unset($value[$k]);
216216
}
217217
}

0 commit comments

Comments
 (0)