line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormFu::Role::CustomRoles; |
2
|
|
|
|
|
|
|
|
3
|
400
|
|
|
400
|
|
194214
|
use strict; |
|
400
|
|
|
|
|
559
|
|
|
400
|
|
|
|
|
15429
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.05'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
400
|
|
|
400
|
|
1456
|
use Moose::Role; |
|
400
|
|
|
|
|
471
|
|
|
400
|
|
|
|
|
2172
|
|
7
|
400
|
|
|
400
|
|
1319509
|
use Moose::Util qw( ensure_all_roles ); |
|
400
|
|
|
|
|
652
|
|
|
400
|
|
|
|
|
2618
|
|
8
|
|
|
|
|
|
|
|
9
|
400
|
|
|
400
|
|
60996
|
use List::Util 1.45 qw( uniq ); |
|
400
|
|
|
|
|
8898
|
|
|
400
|
|
|
|
|
106989
|
|
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
|
8
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
3
|
my @roles = @{ $self->_roles }; |
|
3
|
|
|
|
|
88
|
|
22
|
3
|
|
|
|
|
5
|
my @new; |
23
|
|
|
|
|
|
|
|
24
|
3
|
50
|
33
|
|
|
23
|
if ( 1 == @_ && 'ARRAY' eq ref $_[0] ) { |
|
|
0
|
|
|
|
|
|
25
|
3
|
|
|
|
|
6
|
@new = @{ $_[0] }; |
|
3
|
|
|
|
|
7
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
elsif ( @_ ) { |
28
|
0
|
|
|
|
|
0
|
@new = @_; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
3
|
50
|
|
|
|
10
|
if (@new) { |
32
|
3
|
|
|
|
|
9
|
for my $role (@new) { |
33
|
3
|
50
|
33
|
|
|
25
|
if ( !ref($role) && $role =~ s/^\+// ) { |
|
|
0
|
|
|
|
|
|
34
|
3
|
|
|
|
|
7
|
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
|
|
|
|
|
13
|
@roles = uniq @roles; |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
49
|
ensure_all_roles( $self, @roles ); |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
42464
|
$self->_roles(\@roles); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
10
|
return [@roles]; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |