[Koha-bugs] [Bug 29746] Add a handy Koha::Result::Boolean class
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jan 4 16:20:19 CET 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746
Jonathan Druart <jonathan.druart+koha at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #128883|0 |1
is obsolete| |
--- Comment #16 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 128998
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128998&action=edit
Bug 29746: Add Koha::Result::Boolean
This patch introduces a new OO class that can be used as return value
from methods that need to return boolean values, but also provide some
feedback. This last bit is implemented using Koha::Object::Message
objects that can carry valuable information.
This class can also implement a `to_api()` method so it is suitable for
API usage. And so the Koha::Object::Message class. Will be done as
needed.
If some other result types are required, then we can move some of the
messaging logic to a top-level Koha::Result class this one inherits from
(and the new one as well, say, Integer?).
To test:
1. Apply this patchset
2. Run:
$ kshell
k$ prove t/Koha/Result/Boolean.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: David Nind <david at davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list