yasumi: Missing holiday methods in ProviderInterface
In v2.5 Yasumi::create now returns an instance of ProviderInterface, but this interface is missing most methods needed to actually do anything with holidays:
- No
isHolidaymethod - No
getHolidayDatesmethod (that is the one that my code is using) - No
betweenmethod - No
getHolidayNamesmethod - No
whenIsmethod
These would seem like the necessary methods to get a list of holidays and check if a date is a holiday or what holidays are within a certain timeframe. ProviderInterface has no method at all to check for holidays - which is why my static analyzers report Method Yasumi\ProviderInterface::getHolidayDates does not exist, and anybody using static analyzers and Yasumi will get these kind of errors. The methods are currently still there in AbstractProvider, but according to ProviderInterface they are not necessary.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 20 (8 by maintainers)
The dev-develop branch fixes my phpstan errors as well.
I donβt recall specifically but got many false negatives. Anyway, upgraded to 1.4 and all seem good π
I can report that PHPStan now is green again with develop branch π For us at least, with our usage.
It depends on what methods you want to offer and which ones are internal-adjacent - would also make it easier to change the internal-adjacent ones and communicate to users what methods they should use. Then you could add
@deprecated(and/or trigger aE_USER_DEPRECATED) to the methods that you want to remove (or make private/protected), to avoid immediate BC-breaks, as using deprecated methods will still show up in static analyzers.