Closed juherr closed 5 years ago
To me : error handling is necessary but : --> all getters nullable makes the library just unusable : to me 2 options : check the success and the error before the factory call or directly in the factory. What's your opinion about that ? --> for the nullable datetime : not really sure about that as in the API it is a required integer value and I'd like to stick to the base API specs as much as possible. The user still can ->getTimestamp on his date not sure that that's the library job --> ofc at least we need to fix the tests and the coverage :)
--> all getters nullable makes the library just unusable : to me 2 options : check the success and the error before the factory call or directly in the factory. What's your opinion about that ?
Right, it was already checked after the factory method
--> for the nullable datetime : not really sure about that as in the API it is a required integer value and I'd like to stick to the base API specs as much as possible. The user still can ->getTimestamp on his date not sure that that's the library job
I disagree: The google api is designed without having a specific language in mind. Here, you are building a lib with the php savor with the usage of its std lib. It's what is done in the java lib where they ignore some attributes https://github.com/googlemaps/google-maps-services-java/blob/master/src/main/java/com/google/maps/TimeZoneApi.java#L53-L54 We can/should do the same here.
--> ofc at least we need to fix the tests and the coverage :)
Done
As stated IRL 🎉 : to merge this PR:
100% coverage won't be possible for the moment because I added all exceptions and not only the ones used in the implemented api
Well, I don't understand why the assertion is failing.
As we discussed: assertion was failing because assertsame was checking references on DateTimeZone. We merged a pull request on this branch to have a better coverage and that fixed some errors (nullable) and guidelines (eof). I think I still have work on some unit tests that are lacking even with a good coverage. I'll add an issue on this. Waiting for the CI to run and then will merge this PR and do a new tag release on packagist. Next time we will need to split into more tiny pull requests to ease reviews.
Thanks a lot for your work @juherr ! That helps a lot.
Codecov Report
100% <ø> (ø)
6 <0> (-1)
100% <100%> (ø)
13 <8> (+8)
100% <100%> (ø)
22 <22> (?)
100% <100%> (ø)
7 <3> (+2)
100% <100%> (ø)
15 <8> (+6)
100% <100%> (ø)
10 <5> (+5)
100% <100%> (ø)
8 <2> (ø)
Continue to review full report at Codecov.