Symfony2 API
Class

Symfony\Component\Form\Guess\TypeGuess

class TypeGuess extends Guess

Contains a guessed class name and a list of options for creating an instance of that class

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|null getBestGuess(array $guesses)

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

from Guess
__construct(string $type, array $options, int $confidence)

Constructor

int getConfidence()

Returns the confidence that the guessed value is correct.

from Guess
string getType()

Returns the guessed field type

array getOptions()

Returns the guessed options for creating instances of the guessed type

Details

in Guess at line 71
static public Guess|null 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 An array of guesses

Return Value

Guess|null The guess with the highest confidence

at line 43
public __construct(string $type, array $options, int $confidence)

Constructor

Parameters

string $type The guessed field type
array $options The options for creating instances of the guessed class
int $confidence The confidence that the guessed class name is correct

in Guess at line 109
public int getConfidence()

Returns the confidence that the guessed value is correct.

Return Value

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

at line 56
public string getType()

Returns the guessed field type

Return Value

string

at line 66
public array getOptions()

Returns the guessed options for creating instances of the guessed type

Return Value

array