File Coverage

blib/lib/Sub/HandlesVia/Toolkit/Plain.pm.mite.pm
Criterion Covered Total %
statement 28 35 80.0
branch 3 8 37.5
condition 1 9 11.1
subroutine 9 9 100.0
pod 0 2 0.0
total 41 63 65.0


line stmt bran cond sub pod time code
1             {
2              
3             use strict;
4 3     3   21 use warnings;
  3         8  
  3         95  
5 3     3   23 no warnings qw( once void );
  3         28  
  3         96  
6 3     3   40  
  3         5  
  3         409  
7             our $USES_MITE = "Mite::Class";
8             our $MITE_SHIM = "Sub::HandlesVia::Mite";
9             our $MITE_VERSION = "0.010008";
10              
11             # Mite keywords
12             BEGIN {
13             my ( $SHIM, $CALLER ) =
14 3     3   16 ( "Sub::HandlesVia::Mite", "Sub::HandlesVia::Toolkit::Plain" );
15             ( *after, *around, *before, *extends, *has, *signature_for, *with ) =
16             do {
17 3         5  
18             no warnings 'redefine';
19             (
20 3     3   20 sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) },
  3         7  
  3         604  
21             sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) },
22 0         0 sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) },
23 0         0 sub { },
24 0         0 sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) },
25             sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) },
26 0         0 sub { $SHIM->HANDLE_with( $CALLER, @_ ) },
27 0         0 );
28 0         0 }
29 3         160  
30             BEGIN {
31             require Sub::HandlesVia::Toolkit;
32              
33             use mro 'c3';
34 3     3   1489 our @ISA;
35             push @ISA, "Sub::HandlesVia::Toolkit";
36 3     3   23 }
  3         12  
  3         33  
37 3         11  
38 3         669 # See UNIVERSAL
39             my ( $self, $role ) = @_;
40             our %DOES;
41             return $DOES{$role} if exists $DOES{$role};
42             return 1 if $role eq __PACKAGE__;
43 21     21 0 44 if ( $INC{'Moose/Util.pm'}
44 21         32 and my $meta = Moose::Util::find_meta( ref $self or $self ) )
45 21 50       48 {
46 21 50       135 $meta->can('does_role') and $meta->does_role($role) and return 1;
47 21 50 0     175 }
      33        
48             return $self->SUPER::DOES($role);
49             }
50 0 0 0     0  
51             # Alias for Moose/Moo-compatibility
52 21         75 shift->DOES(@_);
53             }
54              
55             1;