8000 merged branch frosas/patch-1 (PR #4469) · MattKetmo/symfony@78747e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78747e6

Browse files
committed
merged branch frosas/patch-1 (PR symfony#4469)
Commits ------- d55f7ed MethodNotImplementedException -> MethodArgumentValueNotImplementedException cea6489 Accept calling setLenient(false) Discussion ---------- Avoid IntlDateFormatter::setLenient(false) to throw an exception Right now it is breaking because the changes introduced here: symfony@f541844 --------------------------------------------------------------------------- by travisbot at 2012-05-31T01:35:44Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1483621) (merged cea6489 into 49e213c).
2 parents 49e213c + d55f7ed commit 78747e6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,13 @@ public function setCalendar($calendar)
416416
*
417417
* @see http://www.php.net/manual/en/intldateformatter.setlenient.php
418418
*
419-
* @throws MethodNotImplementedException
419+
* @throws MethodArgumentValueNotImplementedException When $lenient is true
420420
*/
421421
public function setLenient($lenient)
422422
{
423-
throw new MethodNotImplementedException(__METHOD__);
423+
if ($lenient) {
424+
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'lenient', $lenient, 'Only the strict parser is supported');
425+
}
424426
}
425427

426428
/**

src/Symfony/Component/Locale/Tests/Stub/StubIntlDateFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ public function testSetCalendar()
906906
}
907907

908908
/**
909-
* @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
909+
* @expectedException Symfony\Component\Locale\Exception\MethodArgumentValueNotImplementedException
910910
*/
911911
public function testSetLenient()
912912
{

0 commit comments

Comments
 (0)
0