| 1 | # ================================================================ | ||||||||||
| 2 | package App::iTan::Command::Delete; | ||||||||||
| 3 | # ================================================================ | ||||||||||
| 4 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use 5.0100; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use MooseX::App::Command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | with qw(App::iTan::Utils); | |||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 12 | 0 | my ( $self, $opts, $args ) = @_; | |||||||||
| 13 | |||||||||||
| 14 | 0 | say 'All unused iTANs have been deleted'; | |||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | $self->dbh->do('DELETE FROM itan | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | WHERE valid = 0 | ||||||||||
| 18 | AND used IS NULL') | ||||||||||
| 19 | or die "ERROR: Cannot execute: " . $self->dbh->errstr(); | ||||||||||
| 20 | |||||||||||
| 21 | 0 | return; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 25 | 1 | 1; | |||||||||
| 26 | |||||||||||
| 27 | =pod | ||||||||||
| 28 | |||||||||||
| 29 | =encoding utf8 | ||||||||||
| 30 | |||||||||||
| 31 | =head1 NAME | ||||||||||
| 32 | |||||||||||
| 33 | App::iTan::Command::Delete - Delete all invalid iTANs | ||||||||||
| 34 | |||||||||||
| 35 | =head1 SYNOPSIS | ||||||||||
| 36 | |||||||||||
| 37 | itan delete | ||||||||||
| 38 | |||||||||||
| 39 | =head1 DESCRIPTION | ||||||||||
| 40 | |||||||||||
| 41 | Delete all invalid iTANs that have not been used yet | ||||||||||
| 42 | |||||||||||
| 43 | =cut | ||||||||||