ValueGuess
extends Guess
in package
Contains a guessed value.
Tags
Table of Contents
Constants
- 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.
Properties
- $confidence : int
- The confidence about the correctness of the value.
- $value : string|int|bool|null
Methods
- __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.
- getValue() : string|int|bool|null
- Returns the guessed value.
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.
$value
private
string|int|bool|null
$value
Methods
__construct()
public
__construct(string|int|bool|null $value, int $confidence) : mixed
Parameters
- $value : string|int|bool|null
- $confidence : int
-
The confidence that the guessed class name is correct
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|nullgetConfidence()
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
getValue()
Returns the guessed value.
public
getValue() : string|int|bool|null