Component/Component/Autocall/Autoload.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 46 CC 5 SCAR 29.7
CC
5
Cov
0%
AUTOLOAD
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 19.5
1 package Class::Component::Component::Autocall::Autoload;
2  
3 use strict;
4 use warnings;
5  
6 use Carp::Clan qw/Class::Component/;
7  
8 our $AUTOLOAD;
9 sub AUTOLOAD {
10 my $self = shift;
11 return unless ref($self);
12 (my $method = $AUTOLOAD) =~ s/.*:://;
13 return if $method eq 'DESTROY';
14  
15 eval {
16 # $self->SUPER::can('AUTOLOAD')->(@_) if $self->SUPER::can('AUTOLOAD');
17 # $self->SUPER::can($method)->(@_) if $self->SUPER::can($method);
18 $self->NEXT($method => @_);
19 };
20 my $super_error = $@;
21  
22 if (ref($self) && (my $plugin = $self->class_component_methods->{$method})) {
23 return $self->call($method, @_);
24 }
25
26 croak $super_error if $super_error;
27 croak sprintf('Can\'t locate object method "%s" via package "%s"', $method, ref($self) || $self);
28 }
29  
30 1;