RecordScheduledReview
in package
Record one graded review against a term's FSRS state.
Phase 2a runs this alongside the legacy status/score update rather than instead of it, so FSRS data accumulates on real reviews while the behaviour users see is unchanged. Nothing reads the resulting schedule to pick review words yet — that switch is opt-in and lands with phase 2b.
Because this is a shadow write, a failure here must never break the review the user just submitted: execute() swallows storage errors and reports false rather than propagating.
Table of Contents
Properties
Methods
- __construct() : mixed
- execute() : bool
- Apply a grade and persist the resulting state plus its log entry.
- preview() : SchedulingResult|null
- Compute the scheduling outcome without persisting it.
Properties
$repository
private
TermScheduleRepositoryInterface
$repository
$scheduler
private
SchedulerInterface
$scheduler
Methods
__construct()
public
__construct([SchedulerInterface|null $scheduler = null ][, TermScheduleRepositoryInterface|null $repository = null ]) : mixed
Parameters
- $scheduler : SchedulerInterface|null = null
- $repository : TermScheduleRepositoryInterface|null = null
execute()
Apply a grade and persist the resulting state plus its log entry.
public
execute(int $wordId, Rating $rating[, DateTimeImmutable|null $now = null ]) : bool
Parameters
- $wordId : int
-
Term being reviewed
- $rating : Rating
-
Grade given
- $now : DateTimeImmutable|null = null
-
Review time (defaults to now)
Return values
bool —Whether scheduling state was recorded
preview()
Compute the scheduling outcome without persisting it.
public
preview(int $wordId, Rating $rating[, DateTimeImmutable|null $now = null ]) : SchedulingResult|null
Used by the API to preview what each grade would do (the "1d / 3d / 10d" hints under the review buttons).
Parameters
- $wordId : int
- $rating : Rating
- $now : DateTimeImmutable|null = null