Lottery
class Lottery (View source)
Properties
Methods
Create a new Lottery instance.
Set the winner callback.
Set the loser callback.
Run the lottery.
Run the lottery.
Run the winner or loser callback, randomly.
Determine if the lottery "wins" or "loses".
The factory that determines the lottery result.
Force the lottery to always result in a win.
Force the lottery to always result in a lose.
Set the sequence that will be used to determine lottery results.
Set the sequence that will be used to determine lottery results.
Indicate that the lottery results should be determined normally.
Indicate that the lottery results should be determined normally.
Set the factory that should be used to determine the lottery results.
Details
static void
alwaysLose(callable|null $callback = null)
Force the lottery to always result in a lose.
static void
fix(array $sequence, callable|null $whenMissing = null)
Set the sequence that will be used to determine lottery results.
static void
forceResultWithSequence(array $sequence, callable|null $whenMissing = null)
Set the sequence that will be used to determine lottery results.
static void
determineResultsNormally()
Indicate that the lottery results should be determined normally.
static void
determineResultNormally()
Indicate that the lottery results should be determined normally.