date-time icon indicating copy to clipboard operation
date-time copied to clipboard

YearWeek, YearMonth and Year are missing `public static parse(string $iso): self`

Open gnutix opened this issue 3 years ago • 0 comments

Hello there,

I've noticed that YearWeek, YearMonth and Year each have a __toString() method returning an ISO representation of the object, but none have a public static function parse(string $iso): self method. Which leads to multiple usages of *::of() methods sprouting around in our code (some using substr, some explode('-W'), etc... unpredictable code, no proper error management... nasty things).

Is that something you would be willing to accept as a PR?

Thanks for your answer. gnutix

gnutix avatar Sep 15 '22 11:09 gnutix