StreakResult
in package
Read onlyYes
FinalYes
Value object for streak calculation results.
Tags
Table of Contents
Properties
- $bestStreak : int
- $currentStreak : int
- $totalActiveDays : int
Methods
- __construct() : mixed
- Constructor.
- toArray() : array{current_streak: int, best_streak: int, total_active_days: int}
- Convert to array for JSON serialization.
Properties
$bestStreak
public
int
$bestStreak
$currentStreak
public
int
$currentStreak
$totalActiveDays
public
int
$totalActiveDays
Methods
__construct()
Constructor.
public
__construct(int $currentStreak, int $bestStreak, int $totalActiveDays) : mixed
Parameters
- $currentStreak : int
-
Consecutive days ending today/yesterday
- $bestStreak : int
-
Longest consecutive run ever
- $totalActiveDays : int
-
Total number of days with any activity
toArray()
Convert to array for JSON serialization.
public
toArray() : array{current_streak: int, best_streak: int, total_active_days: int}