blib/lib/Moose/Exception/MethodExpectsFewerArgs.pm

filter: Statementstmt 100% 12 / 12 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 18 / 18 CC 3 SCAR 9.2
CC
3
Cov
100%
_build_message
3.0
BEGIN
1.0
CRAP 2.5
« blib/lib/Moose/Exception/InvalidArgumentToMethod.pm ↑ Summary blib/lib/Moose/Exception/RoleExclusionConflict.pm »
1 package Moose::Exception::MethodExpectsFewerArgs;
2 6 our $VERSION = '2.4001';
3  
4 6 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 extends 'Moose::Exception';
6  
7 6 has 'method_name' => (
8 is => 'ro',
9 isa => 'Str',
10 required => 1,
11 );
12  
13 6 has 'maximum_args' => (
14 is => 'ro',
15 isa => 'Int',
16 required => 1,
17 );
18  
19 649 ▶sub _build_message {
Subroutine _build_message: called CC=3 SCAR=11.0
20 649 my $self = shift;
21 649 my $max = $self->maximum_args;
22 649 ▶ "Cannot call ".$self->method_name." with ".
Branch: 2 branches
BranchTrueFalseTotal
$max ? : 433 216 649
$max == 1 ? : 336 313 649
23 ( $max ? "more than $max" : 'any'). " argument".( $max == 1 ? '' : 's' );
24 }
25  
26 6 __PACKAGE__->meta->make_immutable;
27 6 1;
« blib/lib/Moose/Exception/InvalidArgumentToMethod.pm ↑ Summary blib/lib/Moose/Exception/RoleExclusionConflict.pm »