Skip to content

Commit

Permalink
merged branch frosas/patch-1 (PR #4469)
Browse files Browse the repository at this point in the history
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:

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).
  • Loading branch information
fabpot committed May 31, 2012
2 parents 49e213c + d55f7ed commit 78747e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php
Expand Up @@ -416,11 +416,13 @@ public function setCalendar($calendar)
*
* @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');
}
}

/**
Expand Down
Expand Up @@ -906,7 +906,7 @@ public function testSetCalendar()
}

/**
* @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
* @expectedException Symfony\Component\Locale\Exception\MethodArgumentValueNotImplementedException
*/
public function testSetLenient()
{
Expand Down

0 comments on commit 78747e6

Please sign in to comment.