TypeGuess
extends Guess
in package
Contains a guessed class name and a list of options for creating an instance of that class.
Tags
Table of Contents
- HIGH_CONFIDENCE = 2
- Marks an instance with a value that is very likely to be correct.
- LOW_CONFIDENCE = 0
- Marks an instance with a value that may be correct.
- MEDIUM_CONFIDENCE = 1
- Marks an instance with a value that is likely to be correct.
- VERY_HIGH_CONFIDENCE = 3
- Marks an instance with a value that is extremely likely to be correct.
- $confidence : int
- The confidence about the correctness of the value.
- $options : mixed
- $type : mixed
- __construct() : mixed
- getBestGuess() : static|null
- Returns the guess most likely to be correct from a list of guesses.
- getConfidence() : int
- Returns the confidence that the guessed value is correct.
- getOptions() : array<string|int, mixed>
- Returns the guessed options for creating instances of the guessed type.
- getType() : string
- Returns the guessed field type.
Constants
HIGH_CONFIDENCE
Marks an instance with a value that is very likely to be correct.
public
mixed
HIGH_CONFIDENCE
= 2
LOW_CONFIDENCE
Marks an instance with a value that may be correct.
public
mixed
LOW_CONFIDENCE
= 0
MEDIUM_CONFIDENCE
Marks an instance with a value that is likely to be correct.
public
mixed
MEDIUM_CONFIDENCE
= 1
VERY_HIGH_CONFIDENCE
Marks an instance with a value that is extremely likely to be correct.
public
mixed
VERY_HIGH_CONFIDENCE
= 3
Properties
$confidence
The confidence about the correctness of the value.
private
int
$confidence
One of VERY_HIGH_CONFIDENCE, HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE.
$options
private
mixed
$options
$type
private
mixed
$type
Methods
__construct()
public
__construct(string $type, array<string|int, mixed> $options, int $confidence) : mixed
Parameters
- $type : string
-
The guessed field type
- $options : array<string|int, mixed>
-
The options for creating instances of the guessed class
- $confidence : int
-
The confidence that the guessed class name is correct
Return values
mixed —getBestGuess()
Returns the guess most likely to be correct from a list of guesses.
public
static getBestGuess(array<string|int, static> $guesses) : static|null
If there are multiple guesses with the same, highest confidence, the returned guess is any of them.
Parameters
- $guesses : array<string|int, static>
-
An array of guesses
Return values
static|null —getConfidence()
Returns the confidence that the guessed value is correct.
public
getConfidence() : int
Return values
int —One of the constants VERY_HIGH_CONFIDENCE, HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE
getOptions()
Returns the guessed options for creating instances of the guessed type.
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getType()
Returns the guessed field type.
public
getType() : string