| 1 | 45 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | package HTML::FormFu::Constraint::Required; | ||||||||||||||||||||
| 4 | 45 | $HTML::FormFu::Constraint::Required::VERSION = '2.06'; | |||||||||||||||||||
| 5 | # ABSTRACT: Required Field Constraint | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 45 | ▶ | use Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 45 | extends 'HTML::FormFu::Constraint'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | sub constrain_value { | ||||||||||||||||||||
| 11 | 121 | ▶ | my ( $self, $value ) = @_; | ||||||||||||||||||
|
Subroutine
constrain_value: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 121 | ▶ | return defined $value && length $value; | ||||||||||||||||||
|
Condition100%3/3
defined $value && length $value
MC/DC100%2/2
defined $value && length $value
defined $value
length $value
Truth table100%3/3
A && B
A= defined $valueB= length $value
| |||||||||||||||||||||
| 14 | } | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 45 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 45 | 1; | |||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | __END__ | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | =pod | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | =encoding UTF-8 | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | HTML::FormFu::Constraint::Required - Required Field Constraint | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | =head1 VERSION | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | version 2.06 | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | =head1 DESCRIPTION | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | States that a value must be submitted. The empty string is not allowed. | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =head1 SEE ALSO | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | Is a sub-class of, and inherits methods from L<HTML::FormFu::Constraint> | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | L<HTML::FormFu> | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | =head1 AUTHOR | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | Carl Franks, C<cfranks@cpan.org> | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | Based on the original source code of L<HTML::Widget::Constraint::All>, by | ||||||||||||||||||||
| 49 | Sebastian Riedel, C<sri@oook.de>. | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | =head1 LICENSE | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | This library is free software, you can redistribute it and/or modify it under | ||||||||||||||||||||
| 54 | the same terms as Perl itself. | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | =head1 AUTHOR | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | Carl Franks <cpan@fireartist.com> | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | This software is copyright (c) 2018 by Carl Franks. | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||
| 65 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | =cut | ||||||||||||||||||||