Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Form] replaced UnexpectedValueException by InvalidArgumentException …

…in Guess

this is a better fit because the error is a logic exception instead of a runtime exception
  • Loading branch information...
commit 6c5eca787701df3063f7e45f59e47a0964b9c297 1 parent 5018dae
@Tobion Tobion authored
Showing with 3 additions and 3 deletions.
  1. +2 −2 Guess/Guess.php
  2. +1 −1  Tests/Guess/GuessTest.php
View
4 Guess/Guess.php
@@ -97,12 +97,12 @@ public static function getBestGuess(array $guesses)
*
* @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;
View
2  Tests/Guess/GuessTest.php
@@ -27,7 +27,7 @@ public function testGetBestGuessReturnsGuessWithHighestConfidence()
}
/**
- * @expectedException \UnexpectedValueException
+ * @expectedException \InvalidArgumentException
*/
public function testGuessExpectsValidConfidence()
{
Please sign in to comment.
Something went wrong with that request. Please try again.