blib/lib/DBIx/Class/InflateColumn/Authen/Passphrase.pm

filter: Statementstmt 100% 24 / 24 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 90.7% 39 / 43 SCAR 13.9
CC
4
Cov
94%
register_column
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
↑ Summary
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package DBIx::Class::InflateColumn::Authen::Passphrase;
5 BEGIN {
6 1 ▶ $DBIx::Class::InflateColumn::Authen::Passphrase::AUTHORITY = 'cpan:FLORA';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 }
8 BEGIN {
9 1 ▶ $DBIx::Class::InflateColumn::Authen::Passphrase::VERSION = '0.01';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 }
11 # ABSTRACT: Inflate/deflate columns to Authen::Passphrase instances
12  
13 1 ▶use Authen::Passphrase;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use parent 'DBIx::Class';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16  
17 sub register_column {
18 3 ▶ my ($self, $column, $info, @rest) = @_;
Subroutine register_column: called CC=4 SCAR=13.9
Pod documented
19  
20 3 $self->next::method($column, $info, @rest);
21 3 ▶ return unless my $encoding = $info->{inflate_passphrase};
Branch: 1 branch
BranchTrueFalseTotal
unless my $encoding = $info->{"inflate_passphrase"} 1 2 3
22  
23 2 ▶ $self->throw_exception(q['rfc2307' and 'crypt' are the only supported types of passphrase columns])
Branch: 1 branch
BranchTrueFalseTotal
unless $encoding eq "rfc2307" or $encoding eq "crypt" 0 2 2
Condition66%2/3
$encoding eq "rfc2307" or $encoding eq "crypt"
l!l&&r!l&&!r
110
MC/DC0%0/2
$encoding eq "rfc2307" or $encoding eq "crypt"
$encoding eq "rfc2307" $encoding eq "crypt"
Truth table66%2/3
A or B
A= $encoding eq "rfc2307"B= $encoding eq "crypt"
ABresult
1X1
011
000
24 unless $encoding eq 'rfc2307' || $encoding eq 'crypt';
25  
26 $self->inflate_column(
27 $column => {
28 2 ▶ inflate => sub { Authen::Passphrase->${\"from_${encoding}"}(shift) },
Subroutine __ANON__: called CC=1 SCAR=0.0
29 2 ▶ deflate => sub { shift->${\"as_${encoding}"} },
Subroutine __ANON__: called CC=1 SCAR=0.0
30 },
31 2 );
32 }
33  
34 1 1;
35  
36 __END__
↑ Summary