diff --git a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php index a448a588e2..d236fb7845 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php @@ -416,11 +416,13 @@ class StubIntlDateFormatter * * @see http://www.php.net/manual/en/intldateformatter.setlenient.php * - * @throws MethodNotImplementedException + * @throws MethodArgumentValueNotImplementedException When $lenient is true */ public function setLenient($lenient) { - throw new MethodNotImplementedException(__METHOD__); + if ($lenient) { + throw new MethodArgumentValueNotImplementedException(__METHOD__, 'lenient', $lenient, 'Only the strict parser is supported'); + } } /** diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php index 79bcd5299c..e289e92399 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php @@ -908,7 +908,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase } /** - * @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException + * @expectedException Symfony\Component\Locale\Exception\MethodArgumentValueNotImplementedException */ public function testSetLenient() {