merged branch bschussek/issue2226 (PR #3321)
Commits
-------
2521962
[Form] Added constant Guess::VERY_HIGH_CONFIDENCE
Discussion
----------
[Form] Added constant Guess::VERY_HIGH_CONFIDENCE
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2226
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2226)
This commit is contained in:
commit
6d793e72bf
@ -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
|
||||
* 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.
|
||||
* added constant Guess::VERY_HIGH_CONFIDENCE
|
||||
|
||||
### HttpFoundation
|
||||
|
||||
|
@ -22,6 +22,12 @@ namespace Symfony\Component\Form\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
|
||||
* @var integer
|
||||
@ -45,6 +51,7 @@ abstract class Guess
|
||||
* @var array
|
||||
*/
|
||||
private static $confidences = array(
|
||||
self::VERY_HIGH_CONFIDENCE,
|
||||
self::HIGH_CONFIDENCE,
|
||||
self::MEDIUM_CONFIDENCE,
|
||||
self::LOW_CONFIDENCE,
|
||||
@ -53,7 +60,8 @@ abstract class Guess
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@ -95,8 +103,8 @@ abstract class Guess
|
||||
/**
|
||||
* Returns the confidence that the guessed value is correct
|
||||
*
|
||||
* @return integer One of the constants HIGH_CONFIDENCE, MEDIUM_CONFIDENCE
|
||||
* and LOW_CONFIDENCE
|
||||
* @return integer One of the constants VERY_HIGH_CONFIDENCE,
|
||||
* HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE
|
||||
*/
|
||||
public function getConfidence()
|
||||
{
|
||||
|
Reference in New Issue
Block a user