File Coverage

blib/lib/App/iTan/Command/Reset.pm
Criterion Covered Total %
statement 11 15 73.3
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 15 23 65.2


line stmt bran cond sub pod time code
1             # ================================================================
2             package App::iTan::Command::Reset;
3             # ================================================================
4 1     1   1283 use utf8;
  1         3  
  1         5  
5 1     1   28 use Moose;
  1         1  
  1         6  
6 1     1   6322 use 5.0100;
  1         5  
7              
8 1     1   5 use MooseX::App::Command;
  1         1  
  1         8  
9             with qw(App::iTan::Utils);
10              
11             sub execute {
12 0     0 0   my ( $self, $opts, $args ) = @_;
13              
14 0           say 'All unused iTANs have been marked as invalid';
15              
16 0 0         $self->dbh->do('UPDATE itan SET valid = 0')
17             or die "ERROR: Cannot execute: " . $self->dbh->errstr();
18              
19 0           return;
20             }
21              
22             __PACKAGE__->meta->make_immutable;
23             1;
24              
25             =pod
26              
27             =encoding utf8
28              
29             =head1 NAME
30              
31             App::iTan::Command::Reset - Reset unused iTANs
32              
33             =head1 SYNOPSIS
34              
35             itan reset
36              
37             =head1 DESCRIPTION
38              
39             Mark all unused iTANs as invalid
40              
41             =cut