File Coverage

blib/lib/DBIx/Class/CDBICompat/DestroyWarning.pm
Criterion Covered Total %
statement 12 18 66.6
branch 0 8 0.0
condition n/a
subroutine 4 5 80.0
pod n/a
total 16 31 51.6


line stmt bran cond sub pod time code
1             package # hide from PAUSE
2             DBIx::Class::CDBICompat::DestroyWarning;
3              
4 2     2   935 use strict;
  2         4  
  2         46  
5 2     2   9 use warnings;
  2         3  
  2         45  
6 2     2   9 use DBIx::Class::_Util 'detected_reinvoked_destructor';
  2         4  
  2         66  
7 2     2   52 use namespace::clean;
  2         9  
  2         15  
8              
9             sub DESTROY {
10 0 0   0     return if &detected_reinvoked_destructor;
11              
12 0           my ($self) = @_;
13 0           my $class = ref $self;
14             warn "$class $self destroyed without saving changes to "
15 0 0         .join(', ', keys %{$self->{_dirty_columns} || {}})
16 0 0         if keys %{$self->{_dirty_columns} || {}};
  0 0          
17             }
18              
19             1;