blib/lib/MooseX/Types/Authen/Passphrase.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 44 / 44 CC 2 SCAR 1.7
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package MooseX::Types::Authen::Passphrase;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $MooseX::Types::Authen::Passphrase::AUTHORITY = 'cpan:NUFFIN';
4 }
5 # git description: v0.03-2-gbdb4541
6 1 $MooseX::Types::Authen::Passphrase::VERSION = '0.04';
7 # ABSTRACT: L<Authen::Passphrase> type constraint and coercions
8  
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Authen::Passphrase;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Authen::Passphrase::RejectAll;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use MooseX::Types::Moose qw(Str Undef);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use MooseX::Types -declare => [qw(Passphrase)];
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 class_type "Authen::Passphrase";
22 1 class_type Passphrase, { class => "Authen::Passphrase" };
23  
24 1 foreach my $type ( "Authen::Passphrase", Passphrase ) {
25 coerce( $type,
26 1 ▶ from Undef, via { Authen::Passphrase::RejectAll->new },
Subroutine __ANON__: called CC=1 SCAR=0.0
27 4 ▶ from Str, via {
Subroutine __ANON__: called CC=2 SCAR=6.9
28 4 ▶ if ( /^\{/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (/^\{/) { } 1 3 4
29 1 return Authen::Passphrase->from_rfc2307($_);
30 } else {
31 3 return Authen::Passphrase->from_crypt($_);
32 #my ( $p, $e ) = do { local $@; my $p = eval { Authen::Passphrase->from_crypt($_) }; ( $p, $@ ) };
33  
34 #if ( ref $p and $p->isa("Authen::Passphrase::RejectAll") and length($_) ) {
35 # warn "e: $e";
36 # return Authen::Passphrase::Clear->new($_);
37 #} elsif ( $e ) {
38 # die $e;
39 #} else {
40 # return $p;
41 #}
42 }
43 },
44 2 );
45 }
46  
47 __PACKAGE__
48  
49 1 __END__
↑ Summary