brick / date-time

Date and time library for PHP
MIT License
321 stars 29 forks source link

Some objects with ISO representations are missing a parse method #68

Closed gnutix closed 9 months ago

gnutix commented 1 year ago

Hello there,

I've noticed that YearWeek and other objects have a __toString() method returning an ISO representation of the object, but not the corresponding 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