Documentation

RecordScheduledReview
in package

FinalYes

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

$repository  : TermScheduleRepositoryInterface
$scheduler  : SchedulerInterface

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

Methods

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
Return values
SchedulingResult|null
On this page

Search results