« lib/Reaction/UI/Widget/Field/Mutable/MatchingPasswords.pm
↑ Summary
lib/Reaction/UI/ViewPort/Field/String/Fragment.pm »
| 1 | package Reaction::Role; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use Moose::Role (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use Reaction::ClassExporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use Reaction::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use Moose::Meta::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | #TODO: review for Reaction::Object switch / Reaction::Meta::Class | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 69 | ▶ | override exports_for_package => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
| |||||||||||||||||||||||||||||
| 13 | 69 | my ($self, $package) = @_; | |||||||||||||||||||||||||||
| 14 | 69 | my %exports = $self->SUPER::exports_for_package($package); | |||||||||||||||||||||||||||
| 15 | 69 | delete $exports{class}; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | $exports{role} = sub { $self->do_role_sub($package, @_); }; | ||||||||||||||||||||||||||
|
Subroutine
: not called CC=1 SCAR=2.6
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||||||||||||||||||||||||||||
| 17 | 69 | return %exports; | |||||||||||||||||||||||||||
| 18 | 6 | }; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 138 | ▶ | override next_import_package => sub { 'Moose::Role' }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 69 | ▶ | override default_base => sub { () }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | override add_method_to_target => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 25 | 0 | my ($self, $target, $method) = @_; | |||||||||||||||||||||||||||
| 26 | 0 | $target->meta->add_method(@$method); | |||||||||||||||||||||||||||
| 27 | 6 | }; | |||||||||||||||||||||||||||
| 28 | 138 | ▶ | override next_import => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 29 | 138 | my ($self) = @_; | |||||||||||||||||||||||||||
| 30 | 138 | my $import = super; | |||||||||||||||||||||||||||
| 31 | # ugh | ||||||||||||||||||||||||||||
| 32 | 69 | ▶ | return sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 33 | 69 | push @_, '-metaclass' => 'Reaction::Meta::Role'; | |||||||||||||||||||||||||||
| 34 | 69 | goto $import; | |||||||||||||||||||||||||||
| 35 | 138 | }; | |||||||||||||||||||||||||||
| 36 | 6 | }; | |||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub do_role_sub { | ||||||||||||||||||||||||||
|
Subroutine
do_role_sub: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | 0 | my ($self, $package, $role, $which, $setup) = @_; | |||||||||||||||||||||||||||
| 39 | 0 | ▶ | confess "Invalid role declaration, should be: role Role which { ... }" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$which eq "which" and ref $setup eq "CODE"
MC/DC0%0/2
$which eq "which" and ref $setup eq "CODE"
$which eq "which"
ref $setup eq "CODE"
Truth table0%0/3
A and B
A= $which eq "which"B= ref $setup eq "CODE"
| |||||||||||||||||||||||||||||
| 40 | unless ($which eq 'which' && ref($setup) eq 'CODE'); | ||||||||||||||||||||||||||||
| 41 | 0 | $self->setup_and_cleanup($role, $setup); | |||||||||||||||||||||||||||
| 42 | }; | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 6 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 6 | 1; | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =head1 NAME | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | Reaction::Role | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | L<Moose::Role> | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =head1 AUTHORS | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | See L<Reaction::Class> for authors. | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =head1 LICENSE | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | See L<Reaction::Class> for the license. | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | =cut | ||||||||||||||||||||||||||||