line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
404
|
|
|
404
|
|
286837
|
use strict; |
|
404
|
|
|
|
|
1065
|
|
|
404
|
|
|
|
|
22681
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Role::CustomRoles; |
4
|
|
|
|
|
|
|
# ABSTRACT: add custom roles |
5
|
|
|
|
|
|
|
$HTML::FormFu::Role::CustomRoles::VERSION = '2.07'; |
6
|
404
|
|
|
404
|
|
2465
|
use Moose::Role; |
|
404
|
|
|
|
|
901
|
|
|
404
|
|
|
|
|
2991
|
|
7
|
404
|
|
|
404
|
|
2106642
|
use Moose::Util qw( ensure_all_roles ); |
|
404
|
|
|
|
|
1001
|
|
|
404
|
|
|
|
|
3281
|
|
8
|
|
|
|
|
|
|
|
9
|
404
|
|
|
404
|
|
103536
|
use List::Util 1.45 qw( uniq ); |
|
404
|
|
|
|
|
10702
|
|
|
404
|
|
|
|
|
144621
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has _roles => ( |
12
|
|
|
|
|
|
|
is => 'rw', |
13
|
|
|
|
|
|
|
default => sub { [] }, |
14
|
|
|
|
|
|
|
lazy => 1, |
15
|
|
|
|
|
|
|
isa => 'ArrayRef', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub roles { |
19
|
3
|
|
|
3
|
0
|
10
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
83
|
my @roles = @{ $self->_roles }; |
|
3
|
|
|
|
|
139
|
|
22
|
3
|
|
|
|
|
8
|
my @new; |
23
|
|
|
|
|
|
|
|
24
|
3
|
50
|
33
|
|
|
29
|
if ( 1 == @_ && 'ARRAY' eq ref $_[0] ) { |
|
|
0
|
|
|
|
|
|
25
|
3
|
|
|
|
|
6
|
@new = @{ $_[0] }; |
|
3
|
|
|
|
|
11
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
elsif (@_) { |
28
|
0
|
|
|
|
|
0
|
@new = @_; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
3
|
50
|
|
|
|
11
|
if (@new) { |
32
|
3
|
|
|
|
|
15
|
for my $role (@new) { |
33
|
3
|
50
|
33
|
|
|
32
|
if ( !ref($role) && $role =~ s/^\+// ) { |
|
|
0
|
|
|
|
|
|
34
|
3
|
|
|
|
|
12
|
push @roles, $role; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
elsif ( !ref $role ) { |
37
|
0
|
|
|
|
|
0
|
push @roles, "HTML::FormFu::Role::$role"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
0
|
|
|
|
|
0
|
push @roles, $role; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
15
|
@roles = uniq @roles; |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
20
|
ensure_all_roles( $self, @roles ); |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
71314
|
$self->_roles( \@roles ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
20
|
return [@roles]; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=pod |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=encoding UTF-8 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
HTML::FormFu::Role::CustomRoles - add custom roles |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
version 2.07 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |