blib/lib/Moose/Exception/ParameterIsNotSubtypeOfParent.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 20 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
_build_message
1.0
CRAP 1.0
« blib/lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm ↑ Summary blib/lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm »
1 package Moose::Exception::ParameterIsNotSubtypeOfParent;
2 2 our $VERSION = '2.4001';
3  
4 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 extends 'Moose::Exception';
6 2 with 'Moose::Exception::Role::TypeConstraint';
7  
8 2 ▶use Moose::Util::TypeConstraints qw/find_type_constraint/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 has 'type_parameter' => (
11 is => 'ro',
12 isa => 'Str',
13 required => 1
14 );
15  
16 2 ▶sub _build_message {
Subroutine _build_message: called CC=1 SCAR=0.0
17 2 my $self = shift;
18 2 my $type_parameter = $self->type_parameter;
19 2 my $type = find_type_constraint( $self->type_name );
20 2 my $parent = $type->parent->type_parameter;
21  
22 2 return "$type_parameter is not a subtype of $parent";
23 }
24  
25 2 __PACKAGE__->meta->make_immutable;
26 2 1;
« blib/lib/Moose/Exception/PackageNameAndNameParamsNotGivenToWrap.pm ↑ Summary blib/lib/Moose/Exception/ReferencesAreNotAllowedAsDefault.pm »