Symfony2 API
Class

Symfony\Component\Form\Guess\Guess

abstract class Guess

Base class for guesses made by TypeGuesserInterface implementation

Each instance contains a confidence value about the correctness of the guess. Thus an instance with confidence HIGHCONFIDENCE is more likely to be correct than an instance with confidence LOWCONFIDENCE.

Constants

VERY_HIGH_CONFIDENCE

Marks an instance with a value that is extremely likely to be correct

HIGH_CONFIDENCE

Marks an instance with a value that is very likely to be correct

MEDIUM_CONFIDENCE

Marks an instance with a value that is likely to be correct

LOW_CONFIDENCE

Marks an instance with a value that may be correct

Methods

static Guess getBestGuess(array $guesses)

Returns the guess most likely to be correct from a list of guesses

__construct(integer $confidence)

Constructor

integer getConfidence()

Returns the confidence that the guessed value is correct

Details

at line 71
static public Guess getBestGuess(array $guesses)

Returns the guess most likely to be correct from a list of guesses

If there are multiple guesses with the same, highest confidence, the returned guess is any of them.

Parameters

array $guesses A list of guesses

Return Value

Guess The guess with the highest confidence

at line 93
public __construct(integer $confidence)

Constructor

Parameters

integer $confidence The confidence

Exceptions

InvalidArgumentException if the given value of confidence is unknown

at line 109
public integer getConfidence()

Returns the confidence that the guessed value is correct

Return Value

integer One of the constants VERYHIGHCONFIDENCE, HIGHCONFIDENCE, MEDIUMCONFIDENCE and LOW_CONFIDENCE