InflateColumn/Crypt/Passphrase.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 100% 42 / 42 SCAR 11.0
CC
3
Cov
100%
register_column
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« CryptColumn.pm ↑ Summary
1 package DBIx::Class::InflateColumn::Crypt::Passphrase;
2 4 $DBIx::Class::InflateColumn::Crypt::Passphrase::VERSION = '0.007';
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use parent 'DBIx::Class';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Crypt::Passphrase 0.007;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub register_column {
14 4 ▶ my ($self, $column, $info, @rest) = @_;
Subroutine register_column: called CC=3 SCAR=11.0
Pod documented
15  
16 4 $self->next::method($column, $info, @rest);
17 4 ▶ return unless my $encoding = $info->{inflate_passphrase};
Branch: 1 branch
BranchTrueFalseTotal
unless my $encoding = $info->{"inflate_passphrase"} 2 2 4
18  
19 2 ▶ my $crypt_passphrase = blessed($encoding) ? $encoding : Crypt::Passphrase->new(%{ $encoding });
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($encoding) ? : 1 1 2
20  
21 $self->inflate_column(
22 $column => {
23 3 ▶ inflate => sub { $crypt_passphrase->curry_with_hash(shift) },
Subroutine __ANON__: called CC=1 SCAR=0.0
24 2 ▶ deflate => sub { shift->raw_hash },
Subroutine __ANON__: called CC=1 SCAR=0.0
25 },
26 2 );
27 }
28  
29 4 1;
30  
31 # ABSTRACT: Inflate/deflate columns to passphrase objects
32  
33 __END__
« CryptColumn.pm ↑ Summary