Signatures/Types.pm

filter: Statementstmt 96.6% 29 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 94.8% 37 / 39 CC 1 SCAR 0.1
CC
1
Cov
97%
__ANON__
1.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Signatures/Param/Positional.pm ↑ Summary Signatures/ParamCollection.pm »
1 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Parse::Method::Signatures::Types;
5  
6 3 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use MooseX::Types::Moose qw/Str ArrayRef/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 use MooseX::Types -declare => [qw/
11 VariableName
12 TypeConstraint
13 Param
14 ParamCollection
15 PositionalParam
16 NamedParam
17 UnpackedParam
18 3 ▶/];
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 subtype VariableName,
21 as Str,
22 180 ▶ where { /^[\$@%](?:[a-z_][a-z_\d]*)?$/i },
Subroutine __ANON__: called CC=1 SCAR=0.0
23 0 ▶ message { 'not a valid variable name' };
Subroutine __ANON__: not called CC=1 SCAR=1.2
24  
25 3 subtype TypeConstraint,
26 as 'Moose::Meta::TypeConstraint';
27  
28 3 class_type Param, { class => 'Parse::Method::Signatures::Param' };
29  
30 3 class_type ParamCollection, { class => 'Parse::Method::Signatures::ParamCollection' };
31  
32 coerce ParamCollection,
33 from ArrayRef,
34 109 ▶ via { Parse::Method::Signatures::ParamCollection->new(params => $_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
35  
36 3 role_type PositionalParam, { role => 'Parse::Method::Signatures::Param::Positional' };
37 3 role_type NamedParam, { role => 'Parse::Method::Signatures::Param::Named' };
38 3 role_type UnpackedParam, { role => 'Parse::Method::Signatures::Param::Unpacked' };
39  
40 3 1;
« Signatures/Param/Positional.pm ↑ Summary Signatures/ParamCollection.pm »