Calendar class uses PeriodInterface as return type for getYear, getMonth, getWeek.
Such method should return, respectively, Year, Month, Week, that are implementing \Iterator.
With the current code, a call to foreach (new Calendar)->getMonth() is marked as invalid by phpstorm ("Can not iterate PeriodInterface").
Calendar class uses
PeriodInterfaceas return type forgetYear,getMonth,getWeek.Such method should return, respectively,
Year,Month,Week, that are implementing\Iterator.With the current code, a call to
foreach (new Calendar)->getMonth()is marked as invalid by phpstorm ("Can not iterate PeriodInterface").