blib/lib/Moose/Exception/TypeConstraintIsAlreadyCreated.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 21 / 21 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/TypeConstraintCannotBeUsedForAParameterizableType.pm ↑ Summary blib/lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm »
1 package Moose::Exception::TypeConstraintIsAlreadyCreated;
2 3 our $VERSION = '2.4001';
3  
4 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 extends 'Moose::Exception';
6 3 with 'Moose::Exception::Role::TypeConstraint';
7  
8 3 ▶use Moose::Util::TypeConstraints 'find_type_constraint';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 has 'package_defined_in' => (
11 is => 'ro',
12 isa => 'Str',
13 required => 1,
14 );
15  
16 6 ▶sub _build_message {
Subroutine _build_message: called CC=1 SCAR=0.0
17 6 my $self = shift;
18 6 my $type_name = $self->type_name;
19 6 my $type = find_type_constraint( $type_name );
20 6 my $type_package_defined_in = $type->_package_defined_in;
21 6 my $package_defined_in = $self->package_defined_in;
22 6 return "The type constraint '$type_name' has already been created in $type_package_defined_in and cannot be created again in $package_defined_in";
23 }
24  
25 3 __PACKAGE__->meta->make_immutable;
26 3 1;
« blib/lib/Moose/Exception/TypeConstraintCannotBeUsedForAParameterizableType.pm ↑ Summary blib/lib/Moose/Exception/TypeParameterMustBeMooseMetaType.pm »