From dcbeeb1df72fe31653a819c3d2941fd3ebd5e16c Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 27 Aug 2012 06:13:48 +0200 Subject: [PATCH] [Form] replaced UnexpectedValueException by InvalidArgumentException in Guess this is a better fit because the error is a logic exception instead of a runtime exception --- src/Symfony/Component/Form/Guess/Guess.php | 4 ++-- src/Symfony/Component/Form/Tests/Guess/GuessTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Guess/Guess.php b/src/Symfony/Component/Form/Guess/Guess.php index de3e4e2cee..0e56cf7664 100644 --- a/src/Symfony/Component/Form/Guess/Guess.php +++ b/src/Symfony/Component/Form/Guess/Guess.php @@ -97,12 +97,12 @@ abstract class Guess * * @param integer $confidence The confidence * - * @throws \UnexpectedValueException if the given value of confidence is unknown + * @throws \InvalidArgumentException if the given value of confidence is unknown */ public function __construct($confidence) { if (!in_array($confidence, self::$confidences)) { - throw new \UnexpectedValueException(sprintf('The confidence should be one of "%s"', implode('", "', self::$confidences))); + throw new \InvalidArgumentException(sprintf('The confidence should be one of "%s"', implode('", "', self::$confidences))); } $this->confidence = $confidence; diff --git a/src/Symfony/Component/Form/Tests/Guess/GuessTest.php b/src/Symfony/Component/Form/Tests/Guess/GuessTest.php index 127d5e048b..235eb6ed2d 100644 --- a/src/Symfony/Component/Form/Tests/Guess/GuessTest.php +++ b/src/Symfony/Component/Form/Tests/Guess/GuessTest.php @@ -27,7 +27,7 @@ class GuessTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \UnexpectedValueException + * @expectedException \InvalidArgumentException */ public function testGuessExpectsValidConfidence() {