https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25039 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #5)
(In reply to Jonathan Druart from comment #4)
I don't think we should start testing all types of all our parameters, that will be a pain. We shoult assume $patron is a Koha::Patron, and *date* is a DateTime.
I you are implying that this shouldn't be enforced in a coding guideline and QA, I *might* agree. But if a bug implements that, I wouldn't reject it because of that.
That said, we've been doing this for a while when we thought it was relevant or a good way to notify the caller so they take actions depending on the failure.
In this specific case we could just make DateTime explode in a try/catch block inside this method and raise the same exceptions. Generally speaking, it is debatable if we should catch them locally or let them through. I think it is saner for writing the controllers if we raise our appropriate exceptions. -- You are receiving this mail because: You are watching all bug changes.