blib/lib/Moose/Exception/RoleExclusionConflict.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 23 / 23 CC 3 SCAR 9.2
CC
3
Cov
100%
_build_message
3.0
BEGIN
1.0
CRAP 2.5
« blib/lib/Moose/Exception/MethodExpectsFewerArgs.pm ↑ Summary blib/lib/Moose/Meta/Method/Meta.pm »
1 package Moose::Exception::RoleExclusionConflict;
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::Role';
7  
8 3 has 'roles' => (
9 is => 'ro',
10 isa => 'ArrayRef',
11 required => 1,
12 );
13  
14 6 ▶sub _build_message {
Subroutine _build_message: called CC=3 SCAR=11.0
15 6 my $self = shift;
16  
17 6 my @roles_array = @{$self->roles};
18 6 ▶ my $role_noun = "Role".( @roles_array == 1 ? '' : 's');
Branch: 1 branch
BranchTrueFalseTotal
@roles_array == 1 ? : 5 1 6
19 6 my $all_roles = join(', ', @roles_array);
20 6 ▶ my $verb = "exclude".( @roles_array == 1 ? 's' : '' );
Branch: 1 branch
BranchTrueFalseTotal
@roles_array == 1 ? : 5 1 6
21 6 my $role_name = $self->role_name;
22  
23 6 return "Conflict detected: $role_noun $all_roles $verb role '$role_name'";
24 }
25  
26 3 __PACKAGE__->meta->make_immutable;
27 3 1;
« blib/lib/Moose/Exception/MethodExpectsFewerArgs.pm ↑ Summary blib/lib/Moose/Meta/Method/Meta.pm »