File Coverage

/tmp/ezpGq1he3d.mite.pm
Criterion Covered Total %
statement 89 128 69.5
branch 20 64 31.2
condition 7 42 16.6
subroutine 21 23 91.3
pod n/a
total 137 257 53.3


line stmt bran cond sub pod time code
1             {
2             use strict;
3 2     2   12 use warnings;
  2         2  
  2         54  
4 2     2   10 no warnings qw( once void );
  2         2  
  2         48  
5 2     2   8  
  2         2  
  2         268  
6             our $USES_MITE = "Mite::Class";
7             our $MITE_SHIM = "Mite::Shim";
8             our $MITE_VERSION = "0.010008";
9             # Mite keywords
10             BEGIN {
11             my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest" );
12 2     2   8 ( *after, *around, *before, *extends, *has, *signature_for, *with ) = do {
13 2         2 no warnings 'redefine';
14             (
15 2     2   12 sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) },
  2         4  
  2         320  
16             sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) },
17 0         0 sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) },
18 0         0 sub {},
19 0         0 sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) },
20             sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) },
21 4         12 sub { $SHIM->HANDLE_with( $CALLER, @_ ) },
22 0         0 );
23 0         0 };
24 2         90  
25              
26             BEGIN {
27            
28            
29             use mro 'c3';
30             our @ISA;
31             push @ISA, "MyTest::Parent";
32 2     2   10 }
  2         2  
  2         22  
33 2     2   90  
34 2         1268 # Standard Moose/Moo-style constructor
35             my $class = ref($_[0]) ? ref(shift) : shift;
36             my $meta = ( $Mite::META{$class} ||= $class->__META__ );
37             my $self = bless {}, $class;
38             my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ };
39 2 50   2   258 my $no_build = delete $args->{__no_BUILD__};
40 2   33     20  
41 2         6 # Attribute first
42 2 50       8 # has declaration, file ../../../../tmp/ezpGq1he3d, line 17
  0 50       0  
43 2         4 $self->{"first"} = ( exists( $args->{"first"} ) ? $args->{"first"} : $MyTest::Parent::__first_DEFAULT__->( $self ) );
44              
45             # Attribute second
46             # has declaration, file ../../../../tmp/ezpGq1he3d, line 20
47 2 50       6 $self->{"second"} = ( exists( $args->{"second"} ) ? $args->{"second"} : $MyTest::Parent::__second_DEFAULT__->( $self ) );
48              
49             # Attribute third
50             # has declaration, file ../../../../tmp/ezpGq1he3d, line 8
51 2 50       6 $self->{"third"} = ( exists( $args->{"third"} ) ? $args->{"third"} : $MyTest::__third_DEFAULT__->( $self ) );
52              
53             # Attribute fourth
54             # has declaration, file ../../../../tmp/ezpGq1he3d, line 11
55 2 50       6 $self->{"fourth"} = ( exists( $args->{"fourth"} ) ? $args->{"fourth"} : $MyTest::__fourth_DEFAULT__->( $self ) );
56              
57              
58             # Call BUILD methods
59 2 50       8 $self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } );
60              
61             # Unrecognized parameters
62             my @unknown = grep not( /\A(?:f(?:irst|ourth)|second|third)\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) );
63 2 50 33     24  
  2 50       12  
64             return $self;
65             }
66 2 50       2  
  2         6  
  2         4  
67             my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };
68 2         8  
69             # Accessors for fourth
70             # has declaration, file ../../../../tmp/ezpGq1he3d, line 11
71             if ( $__XS ) {
72             Class::XSAccessor->import(
73             chained => 1,
74             "getters" => { "fourth" => "fourth" },
75             );
76             }
77             else {
78             *fourth = sub { @_ == 1 or Mite::Shim::croak( 'Reader "fourth" usage: $self->fourth()' ); $_[0]{"fourth"} };
79             }
80              
81             # Accessors for third
82             # has declaration, file ../../../../tmp/ezpGq1he3d, line 8
83             if ( $__XS ) {
84             Class::XSAccessor->import(
85             chained => 1,
86             "getters" => { "third" => "third" },
87             );
88             }
89             else {
90             *third = sub { @_ == 1 or Mite::Shim::croak( 'Reader "third" usage: $self->third()' ); $_[0]{"third"} };
91             }
92              
93              
94             # See UNIVERSAL
95             my ( $self, $role ) = @_;
96             our %DOES;
97             return $DOES{$role} if exists $DOES{$role};
98             return 1 if $role eq __PACKAGE__;
99             if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) {
100 14     14   20 $meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1;
101 14         10 }
102 14 50       22 return $self->SUPER::DOES( $role );
103 14 50       18 }
104 14 50 0     28  
      33        
105 0 0 0     0 # Alias for Moose/Moo-compatibility
106             shift->DOES( @_ );
107 14         22 }
108              
109             1;
110             use strict;
111             use warnings;
112 14     14   3284 no warnings qw( once void );
113              
114             our $USES_MITE = "Mite::Class";
115             our $MITE_SHIM = "Mite::Shim";
116             our $MITE_VERSION = "0.010008";
117             # Mite keywords
118 2     2   12 BEGIN {
  2         4  
  2         66  
119 2     2   10 my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest::Parent" );
  2         2  
  2         70  
120 2     2   10 ( *after, *around, *before, *extends, *has, *signature_for, *with ) = do {
  2         14  
  2         230  
121             no warnings 'redefine';
122             (
123             sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) },
124             sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) },
125             sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) },
126             sub {},
127 2     2   10 sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) },
128 2         2 sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) },
129             sub { $SHIM->HANDLE_with( $CALLER, @_ ) },
130 2     2   12 );
  2         2  
  2         298  
131             };
132 0         0  
133 0         0 # Gather metadata for constructor and destructor
134 0         0 no strict 'refs';
135             my $class = shift; $class = ref($class) || $class;
136 4         10 my $linear_isa = mro::get_linear_isa( $class );
137 0         0 return {
138 0         0 BUILD => [
139 2         96 map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
140             map { "$_\::BUILD" } reverse @$linear_isa
141             ],
142             DEMOLISH => [
143             map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
144             map { "$_\::DEMOLISH" } @$linear_isa
145 2     2   10 ],
  2         4  
  2         1054  
146 2   33 2   4 HAS_BUILDARGS => $class->can('BUILDARGS'),
  2         10  
147 2         6 HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'),
148             };
149             }
150 4 50       6  
  4         16  
  0         0  
151 4         14  
152             # Standard Moose/Moo-style constructor
153             my $class = ref($_[0]) ? ref(shift) : shift;
154 4 50       32 my $meta = ( $Mite::META{$class} ||= $class->__META__ );
  4         48  
  0         0  
155 2         48 my $self = bless {}, $class;
  4         6  
156             my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ };
157             my $no_build = delete $args->{__no_BUILD__};
158              
159             # Attribute first
160             # has declaration, file ../../../../tmp/ezpGq1he3d, line 17
161             $self->{"first"} = ( exists( $args->{"first"} ) ? $args->{"first"} : $MyTest::Parent::__first_DEFAULT__->( $self ) );
162              
163             # Attribute second
164             # has declaration, file ../../../../tmp/ezpGq1he3d, line 20
165 0 0   0   0 $self->{"second"} = ( exists( $args->{"second"} ) ? $args->{"second"} : $MyTest::Parent::__second_DEFAULT__->( $self ) );
166 0   0     0  
167 0         0  
168 0 0       0 # Call BUILD methods
  0 0       0  
169 0         0 $self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } );
170              
171             # Unrecognized parameters
172             my @unknown = grep not( /\A(?:first|second)\z/ ), keys %{$args}; @unknown and Mite::Shim::croak( "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) );
173 0 0       0  
174             return $self;
175             }
176              
177 0 0       0 # Used by constructor to call BUILD methods
178             my $class = ref( $_[0] );
179             my $meta = ( $Mite::META{$class} ||= $class->__META__ );
180             $_->( @_ ) for @{ $meta->{BUILD} || [] };
181 0 0 0     0 }
  0 0       0  
182              
183             # Destructor should call DEMOLISH methods
184 0 0       0 my $self = shift;
  0         0  
  0         0  
185             my $class = ref( $self ) || $self;
186 0         0 my $meta = ( $Mite::META{$class} ||= $class->__META__ );
187             my $in_global_destruction = defined ${^GLOBAL_PHASE}
188             ? ${^GLOBAL_PHASE} eq 'DESTRUCT'
189             : Devel::GlobalDestruction::in_global_destruction();
190             for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) {
191 0     0   0 my $e = do {
192 0   0     0 local ( $?, $@ );
193 0 0       0 eval { $demolisher->( $self, $in_global_destruction ) };
  0         0  
194             $@;
195             };
196             no warnings 'misc'; # avoid (in cleanup) warnings
197             die $e if $e; # rethrow
198 2     2   5862 }
199 2   33     8 return;
200 2   33     8 }
201 2 50       8  
202             my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };
203              
204 2 50       4 # Accessors for first
  2         6  
205 0         0 # has declaration, file ../../../../tmp/ezpGq1he3d, line 17
206 0         0 if ( $__XS ) {
207 0         0 Class::XSAccessor->import(
  0         0  
208 0         0 chained => 1,
209             "getters" => { "first" => "first" },
210 2     2   26 );
  2         4  
  2         778  
211 0 0       0 }
212             else {
213 2         22 *first = sub { @_ == 1 or Mite::Shim::croak( 'Reader "first" usage: $self->first()' ); $_[0]{"first"} };
214             }
215              
216             # Accessors for second
217             # has declaration, file ../../../../tmp/ezpGq1he3d, line 20
218             if ( $__XS ) {
219             Class::XSAccessor->import(
220             chained => 1,
221             "getters" => { "second" => "second" },
222             );
223             }
224             else {
225             *second = sub { @_ == 1 or Mite::Shim::croak( 'Reader "second" usage: $self->second()' ); $_[0]{"second"} };
226             }
227              
228              
229             # See UNIVERSAL
230             my ( $self, $role ) = @_;
231             our %DOES;
232             return $DOES{$role} if exists $DOES{$role};
233             return 1 if $role eq __PACKAGE__;
234             if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) {
235             $meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1;
236             }
237             return $self->SUPER::DOES( $role );
238             }
239              
240             # Alias for Moose/Moo-compatibility
241             shift->DOES( @_ );
242             }
243              
244             1;