lib/HTML/FormFu/Role/Element/NonBlock.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 87.1% 34 / 39 CC 4 SCAR 6.6
CC
4
Cov
90%
string
3.1
__ANON__
2.0
BEGIN
1.0
CRAP 1.9
« lib/HTML/FormFu/Deflator/Strftime.pm ↑ Summary lib/HTML/FormFu/Constraint/DateTime.pm »
1 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Role::Element::NonBlock;
4 6 $HTML::FormFu::Role::Element::NonBlock::VERSION = '2.09';
5 # ABSTRACT: base class for single-tag elements
6  
7 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use HTML::FormFu::Util qw( process_attrs );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 has tag => ( is => 'rw', traits => ['Chained'] );
12  
13 2 ▶after BUILD => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 2 my $self = shift;
15  
16 2 $self->filename('non_block');
17  
18 2 return;
19 6 };
20  
21 3 ▶around render_data_non_recursive => sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
22 3 my ( $orig, $self, $args ) = @_;
23  
24 3 ▶ my $render = $self->$orig(
Branch: 1 branch
BranchTrueFalseTotal
$args ? : 0 3 3
25 { tag => $self->tag,
26 $args ? %$args : (),
27 } );
28  
29 3 return $render;
30 6 };
31  
32 3 ▶sub string {
Subroutine string: called CC=3 SCAR=11.3
Pod undocumented
33 3 my ( $self, $args ) = @_;
34  
35 3 ▶ $args ||= {};
Condition50%1/2
$args ||= {}
l!l
03
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
Aresult
11
00
36  
37 my $render
38 = exists $args->{render_data}
39 ? $args->{render_data}
40 3 ▶ : $self->render_data;
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'render_data'} ? : 0 3 3
41  
42 # non_block template
43  
44 my $html = sprintf "<%s%s />",
45 $render->{tag},
46 3 process_attrs( $render->{attributes} ),
47 ;
48  
49 3 return $html;
50 }
51  
52 6 1;
53  
54 __END__
« lib/HTML/FormFu/Deflator/Strftime.pm ↑ Summary lib/HTML/FormFu/Constraint/DateTime.pm »