celest-time / celest

Celest provides a alternative date and time API for PHP.
http://celest-time.org/
GNU General Public License v2.0
9 stars 1 forks source link

Add JsonSerializable implementations #4

Open MazeChaZer opened 7 years ago

MazeChaZer commented 7 years ago

Resolves #3 I used __toString() everywhere, except for Year, Month and DayOfWeek, where I just used the integer value. Seemed sensible to me, but I'm not very opiniated about this.

hanikesn commented 7 years ago

Thanks for the MR.

I used __toString() everywhere, except for Year, Month and DayOfWeek, where I just used the integer value. Seemed sensible to me, but I'm not very opiniated about this.

Yeah, I think that's also what most people will expect even if it breaks consistency.

Unfortunately before I can merge it there also need to be the tests for the code, which mostly can be reused from the _toString() tests. Also it would be great to have proper documentation in place and not the generic phpdoc from php itself.

MazeChaZer commented 7 years ago

Alright, I will add those

MazeChaZer commented 7 years ago

I added unit tests for all new methods and simple documentation.

MazeChaZer commented 6 years ago

What's the status on this?