https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25039
--- Comment #2 from Jonathan Druart <[email protected]> --- From bug 25020 comment 6: """ A quick note, I think this kind of tests is overkill and not needed: + Koha::Exceptions::WrongParameter->throw( + "'hard_due_date' must be a DateTime object" + ) unless $hard_due_date->isa('DateTime'); + + $due_date = $hard_due_date->clone->set( + hour => $due_date->hour, + minute => $due_date->minute, + second => $due_date->second + ); + } + else { + Koha::Exceptions::WrongParameter->throw( + "'days' must be an integer" + ) unless looks_like_number($days); + $due_date->add( days => $days ); Developers will get an error anyway if $days is not an integer (DateTime will raise its own meaningful exception), or $hard_due_date is not a DateTime. """ -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
