[Form] Added constant Guess::VERY_HIGH_CONFIDENCE

This commit is contained in:
Bernhard Schussek 2012-02-10 12:01:35 +01:00
parent 11e3516583
commit 2521962260
2 changed files with 12 additions and 3 deletions

View File

@ -207,6 +207,7 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
* added options "add_method" and "remove_method" to collection and choice type * added options "add_method" and "remove_method" to collection and choice type
* forms now don't create an empty object anymore if they are completely * forms now don't create an empty object anymore if they are completely
empty and not required. The empty value for such forms is null. empty and not required. The empty value for such forms is null.
* added constant Guess::VERY_HIGH_CONFIDENCE
### HttpFoundation ### HttpFoundation

View File

@ -22,6 +22,12 @@ namespace Symfony\Component\Form\Guess;
*/ */
abstract class Guess abstract class Guess
{ {
/**
* Marks an instance with a value that is extremely likely to be correct
* @var integer
*/
const VERY_HIGH_CONFIDENCE = 3;
/** /**
* Marks an instance with a value that is very likely to be correct * Marks an instance with a value that is very likely to be correct
* @var integer * @var integer
@ -45,6 +51,7 @@ abstract class Guess
* @var array * @var array
*/ */
private static $confidences = array( private static $confidences = array(
self::VERY_HIGH_CONFIDENCE,
self::HIGH_CONFIDENCE, self::HIGH_CONFIDENCE,
self::MEDIUM_CONFIDENCE, self::MEDIUM_CONFIDENCE,
self::LOW_CONFIDENCE, self::LOW_CONFIDENCE,
@ -53,7 +60,8 @@ abstract class Guess
/** /**
* The confidence about the correctness of the value * The confidence about the correctness of the value
* *
* One of HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE. * One of VERY_HIGH_CONFIDENCE, HIGH_CONFIDENCE, MEDIUM_CONFIDENCE
* and LOW_CONFIDENCE.
* *
* @var integer * @var integer
*/ */
@ -95,8 +103,8 @@ abstract class Guess
/** /**
* Returns the confidence that the guessed value is correct * Returns the confidence that the guessed value is correct
* *
* @return integer One of the constants HIGH_CONFIDENCE, MEDIUM_CONFIDENCE * @return integer One of the constants VERY_HIGH_CONFIDENCE,
* and LOW_CONFIDENCE * HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE
*/ */
public function getConfidence() public function getConfidence()
{ {