Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return types in Calendar #48

Open
garak opened this issue Sep 25, 2017 · 1 comment
Open

Wrong return types in Calendar #48

garak opened this issue Sep 25, 2017 · 1 comment

Comments

@garak
Copy link
Contributor

garak commented Sep 25, 2017

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

@yohang
Copy link
Owner

yohang commented Jan 13, 2019

True.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants