blib/lib/Moose/Exception/OverrideConflictInComposition.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 19 / 19 CC 2 SCAR 5.1
CC
2
Cov
100%
_build_message
2.0
BEGIN
1.0
CRAP 1.7
« blib/lib/Moose/Exception/MethodExpectsMoreArgs.pm ↑ Summary blib/lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm »
1 package Moose::Exception::OverrideConflictInComposition;
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 'role_being_applied_name' => (
9 is => 'ro',
10 isa => 'Str',
11 required => 1
12 );
13  
14 3 has 'method_name' => (
15 is => 'ro',
16 isa => 'Str',
17 required => 1
18 );
19  
20 3 has 'two_overrides_found' => (
21 is => 'ro',
22 isa => 'Bool',
23 required => 1,
24 default => 0
25 );
26  
27 4 ▶sub _build_message {
Subroutine _build_message: called CC=2 SCAR=6.9
28 4 my $self = shift;
29  
30 4 ▶ if( $self->two_overrides_found ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->two_overrides_found) { } 2 2 4
31 2 return "Role '" . $self->role_being_applied_name . "' has encountered an 'override' method conflict " .
32 "during composition (Two 'override' methods of the same name encountered). " .
33 "This is a fatal error.";
34 }
35 else {
36 2 return "Role '".$self->role_being_applied_name."' has encountered an 'override' method conflict ".
37 "during composition (A local method of the same name as been found). ".
38 "This is a fatal error.";
39 }
40 }
41  
42 3 __PACKAGE__->meta->make_immutable;
43 3 1;
« blib/lib/Moose/Exception/MethodExpectsMoreArgs.pm ↑ Summary blib/lib/Moose/Exception/PackageDoesNotUseMooseExporter.pm »