From b2e9d8d97a0cba6aa2997de42e50dc63023e21b3 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Jan 2015 18:33:44 +0100 Subject: [PATCH] #6598 - using caught `IntlException` instances as previous exceptions --- library/Zend/I18n/Validator/DateTime.php | 6 +++--- library/Zend/I18n/Validator/Float.php | 4 ++-- library/Zend/I18n/Validator/Int.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/Zend/I18n/Validator/DateTime.php b/library/Zend/I18n/Validator/DateTime.php index 5a76ebd48da..f67886b24bb 100644 --- a/library/Zend/I18n/Validator/DateTime.php +++ b/library/Zend/I18n/Validator/DateTime.php @@ -271,8 +271,8 @@ public function isValid($value) if (intl_is_failure($formatter->getErrorCode())) { throw new ValidatorException\InvalidArgumentException($formatter->getErrorMessage()); } - } catch (IntlException $e) { - throw new ValidatorException\InvalidArgumentException($e->getMessage()); + } catch (IntlException $intlException) { + throw new ValidatorException\InvalidArgumentException($e->getMessage(), 0, $intlException); } @@ -283,7 +283,7 @@ public function isValid($value) $this->error(self::INVALID_DATETIME); return false; } - } catch (IntlException $e) { + } catch (IntlException $intlException) { $this->error(self::INVALID_DATETIME); return false; } diff --git a/library/Zend/I18n/Validator/Float.php b/library/Zend/I18n/Validator/Float.php index a9ba59b22ac..b52aa3962cf 100644 --- a/library/Zend/I18n/Validator/Float.php +++ b/library/Zend/I18n/Validator/Float.php @@ -127,8 +127,8 @@ public function isValid($value) if (intl_is_failure($formatter->getErrorCode())) { throw new Exception\InvalidArgumentException($formatter->getErrorMessage()); } - } catch (IntlException $e) { - throw new Exception\InvalidArgumentException($e->getMessage()); + } catch (IntlException $intlException) { + throw new Exception\InvalidArgumentException($e->getMessage(), 0, $intlException); } if (StringUtils::hasPcreUnicodeSupport()) { diff --git a/library/Zend/I18n/Validator/Int.php b/library/Zend/I18n/Validator/Int.php index ad2cced121a..7f8df04b93c 100644 --- a/library/Zend/I18n/Validator/Int.php +++ b/library/Zend/I18n/Validator/Int.php @@ -114,8 +114,8 @@ public function isValid($value) if (intl_is_failure($format->getErrorCode())) { throw new Exception\InvalidArgumentException("Invalid locale string given"); } - } catch (IntlException $e) { - throw new Exception\InvalidArgumentException("Invalid locale string given"); + } catch (IntlException $intlException) { + throw new Exception\InvalidArgumentException("Invalid locale string given", 0, $intlException); } try { @@ -124,7 +124,7 @@ public function isValid($value) $this->error(self::NOT_INT); return false; } - } catch (IntlException $e) { + } catch (IntlException $intlException) { $this->error(self::NOT_INT); return false; }