File Coverage

blib/lib/Moose/Exception/InvalidArgumentsToTraitAliases.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 13 13 100.0


line stmt bran cond sub pod time code
1             package Moose::Exception::InvalidArgumentsToTraitAliases;
2             our $VERSION = '2.2205';
3              
4 1     1   690 use Moose;
  1         3  
  1         6  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::Class';
7              
8 1     1   8 use Scalar::Util qw(reftype);
  1         3  
  1         195  
9              
10             has 'alias' => (
11             is => 'ro',
12             isa => 'Any',
13             required => 1
14             );
15              
16             has 'package_name' => (
17             is => 'ro',
18             isa => 'Str',
19             required => 1
20             );
21              
22             sub _build_message {
23 1     1   3 my $self = shift;
24 1         37 my $alias = $self->alias;
25 1         6 my $reftype_alias = reftype($alias);
26              
27 1         27 return "$reftype_alias references are not "
28             . "valid arguments to the 'trait_aliases' option";
29             }
30              
31             __PACKAGE__->meta->make_immutable;
32             1;