lib/HTML/FormFu/Filter/TrimEdges.pm

filter: Statementstmt 100% 15 / 15 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 90.4% 19 / 21 SCAR 6.9
CC
2
Cov
94%
filter
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« lib/HTML/FormFu/Deflator.pm ↑ Summary lib/HTML/FormFu/Filter/HTMLEscape.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Filter::TrimEdges;
4 2 $HTML::FormFu::Filter::TrimEdges::VERSION = '2.06';
5 # ABSTRACT: filter trimming whitespace
6  
7 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 extends 'HTML::FormFu::Filter';
9  
10 sub filter {
11 1 ▶ my ( $self, $value ) = @_;
Subroutine filter: called CC=2 SCAR=7.0
Pod undocumented
12  
13 1 ▶ return if !defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 1 1
14  
15 1 $value =~ s/^\s+//;
16 1 $value =~ s/\s+\z//;
17  
18 1 return $value;
19 }
20  
21 2 __PACKAGE__->meta->make_immutable;
22  
23 2 1;
24  
25 __END__
26  
27 =pod
28  
29 =encoding UTF-8
30  
31 =head1 NAME
32  
33 HTML::FormFu::Filter::TrimEdges - filter trimming whitespace
34  
35 =head1 VERSION
36  
37 version 2.06
38  
39 =head1 DESCRIPTION
40  
41 Trim whitespaces from beginning and end of string.
42  
43 =head1 AUTHOR
44  
45 Mario Minati, C<mario@minati.de>
46  
47 Based on the original source code of L<HTML::Widget::Filter::TrimEdges>, by
48 Sebastian Riedel, C<sri@oook.de>
49  
50 =head1 LICENSE
51  
52 This library is free software, you can redistribute it and/or modify it
53 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
« lib/HTML/FormFu/Deflator.pm ↑ Summary lib/HTML/FormFu/Filter/HTMLEscape.pm »