https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746

--- Comment #10 from Jonathan Druart <[email protected]> ---
(In reply to Jonathan Druart from comment #9)
> +use overload bool => \&as_bool;
> 
> I didn't notice that the first time I read this patch, and it's awesome!
> 
> I will provide you a QA feedback soon.

And, to explain a bit more:

"""
use Koha::Result::Boolean;
sub ok {
    return Koha::Result::Boolean->new(1)->add_message({message => "this is not
an error"});
}
sub nok {
    return Koha::Result::Boolean->new(0)->add_message({message => "this is an
error"});
}

if ( ok() ) { 
    say "all good";
}
unless ( nok() ) { 
    say "there was an error";
}
"""

=> will display "all good" and "there was an error"

-- 
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/

Reply via email to