CalendR icon indicating copy to clipboard operation
CalendR copied to clipboard

Wrong return types in Calendar

Open garak opened this issue 6 years ago • 1 comments

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").

garak avatar Sep 25 '17 14:09 garak

True.

I'll have a look a this for CalendR 3, with drop of PHP 5 support and introduction of return types.

yohang avatar Jan 13 '19 17:01 yohang