lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ChangeType.pm

filter: Statementstmt 100% 18 / 18 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 88.8% 24 / 27 CC 3 SCAR 7.2
CC
3
Cov
91%
execute
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/EnableProtection.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ResetPassword.pm »
1 package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::ChangeType;
2 # ABSTRACT: Change a Storage Box type
3  
4 1 our $VERSION = '0.102';
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MooX::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl storage-box change-type --type <type> <storage-box>';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 with 'WWW::Hetzner::CLI::Role::WaitsForAction';
10  
11 1 option type => ( is => 'ro', format => 's', required => 1, doc => 'Target Storage Box type ID or name' );
12  
13 2 ▶sub execute {
Subroutine execute: called CC=3 SCAR=11.3
Pod undocumented
14 2 my ($self, $args, $chain) = @_;
15 2 ▶ my $id = $args->[0] or die "Usage: hcloud.pl storage-box change-type --type <type> <storage-box>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $id = $args->[0] or die "Usage: hcloud.pl storage-box change-type --type <type> <storage-box>\n" 2 0 2
16 2 my $action = $chain->[0]->storage->storage_boxes->change_type($id, storage_box_type => $self->type);
17 2 $self->handle_action($action);
18 1 ▶ print $self->no_wait ? "Storage Box type change requested.\n" : "Storage Box type changed.\n";
Branch: 1 branch
BranchTrueFalseTotal
$self->no_wait ? : 1 0 1
19 }
20  
21 1 1;
22  
23 __END__
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/EnableProtection.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/ResetPassword.pm »