| 1 | # Version 0 module | ||||||||||||||||||||||||||||
| 2 | package Validator::Custom::Constraints; | ||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use Object::Simple -base; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Scalar::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 5 | has 'constraints'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 5 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=15.2
| |||||||||||||||||||||||||||||
| 10 | 5 | my $self = shift; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 5 | my ($package, $method) = split /::(\w+)$/, our $AUTOLOAD; | |||||||||||||||||||||||||||
| 13 | 5 | ▶ | Carp::croak "Undefined subroutine &${package}::$method called" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($self) and $self->isa(__PACKAGE__)
MC/DC0%0/2
builtin::blessed($self) and $self->isa(__PACKAGE__)
builtin::blessed($self)
$self->isa(__PACKAGE__)
Truth table33%1/3
A and B
A= builtin::blessed($self)B= $self->isa(__PACKAGE__)
| |||||||||||||||||||||||||||||
| 14 | unless Scalar::Util::blessed $self && $self->isa(__PACKAGE__); | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # Call helper with current controller | ||||||||||||||||||||||||||||
| 17 | Carp::croak qq{Can't locate object method "$method" via package "$package"} | ||||||||||||||||||||||||||||
| 18 | 5 | ▶ | unless my $helper = $self->constraints->{$method}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 5 | return $helper->(@_); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub DESTROY { } | ||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 5 | 1; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | Validator::Custom::Constraints - Constraint autoloading system | ||||||||||||||||||||||||||||