| 1 | # This code is part of Perl distribution Mail-Box version 4.02. | ||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.06. | ||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2001-2026 by Mark Overmeer. | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | package Mail::Box::Identity;{ | ||||||||||||||||||||||||||||
| 13 | 3 | our $VERSION = '4.02'; | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use parent qw/User::Identity::Item Mail::Reporter/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 3 | ▶ | use Log::Report 'mail-box', import => [ qw/__x error/ ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 3 | ▶ | use Mail::Box::Collection (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | # tests in tests/52message/30collect.t | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | #-------------------- | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | sub new(@) | ||||||||||||||||||||||||||||
| 30 | 13 | ▶ | { my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 13 | ▶ | unshift @_, 'name' if @_ % 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 13 | $class->Mail::Reporter::new(@_); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | sub init($) | ||||||||||||||||||||||||||||
| 36 | 13 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 13 | $self->Mail::Reporter::init($args); | |||||||||||||||||||||||||||
| 39 | 13 | $self->User::Identity::init($args); | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 13 | $self->{MBI_location} = delete $args->{location}; | |||||||||||||||||||||||||||
| 42 | 13 | $self->{MBI_ftype} = delete $args->{folder_type}; | |||||||||||||||||||||||||||
| 43 | 13 | $self->{MBI_manager} = delete $args->{manager}; | |||||||||||||||||||||||||||
| 44 | 13 | ▶ | $self->{MBI_subf_type} = delete $args->{subf_type}||'Mail::Box::Collection'; | ||||||||||||||||||||||||||
|
Condition50%1/2
delete $args->{'subf_type'} || 'Mail::Box::Collection'
MC/DC0%0/1
delete $args->{'subf_type'} || 'Mail::Box::Collection'
delete $args->{'subf_type'}
Truth table50%1/2
A
A= delete $args->{'subf_type'}
| |||||||||||||||||||||||||||||
| 45 | 13 | $self->{MBI_only_subs} = delete $args->{only_subs}; | |||||||||||||||||||||||||||
| 46 | 13 | $self->{MBI_marked} = delete $args->{marked}; | |||||||||||||||||||||||||||
| 47 | 13 | $self->{MBI_deleted} = delete $args->{deleted}; | |||||||||||||||||||||||||||
| 48 | 13 | ▶ | $self->{MBI_inferiors} = exists $args->{inferiors} ? $args->{inferiors} : 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 13 | $self; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | #-------------------- | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub type { "mailbox" } | ||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | sub fullname(;$) | ||||||||||||||||||||||||||||
| 59 | 64 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
fullname: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 60 | 64 | ▶ | my $delim = @_ && defined $_[0] ? shift : '/'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 64 | ▶ | my $parent = $self->parent or return $self->name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | 42 | $parent->parent->fullname($delim) . $delim . $self->name; | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | sub location(;$) | ||||||||||||||||||||||||||||
| 68 | 77 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
location: called CC=4 SCAR=14.1
Pod
documented
| |||||||||||||||||||||||||||||
| 69 | 77 | ▶ | return ($self->{MBI_location} = shift) if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | 77 | ▶ | return $self->{MBI_location} if defined $self->{MBI_location}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 52 | ▶ | my $parent = $self->parent | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | or error __x"toplevel directory requires explicit location."; | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 52 | $self->folderType->nameOfSubFolder($self->name, $parent->parent->location) | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | sub folderType() | ||||||||||||||||||||||||||||
| 81 | 222 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
folderType: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 82 | 222 | ▶ | return $self->{MBI_ftype} if defined $self->{MBI_ftype}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 147 | ▶ | my $parent = $self->parent | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 85 | or error __x"toplevel directory requires explicit folder type."; | ||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 147 | $parent->parent->folderType; | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | sub manager() | ||||||||||||||||||||||||||||
| 93 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
manager: called CC=3 SCAR=16.5
Pod
documented
| |||||||||||||||||||||||||||||
| 94 | 1 | ▶ | return $self->{MBI_manager} if $self->{MBI_manager}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | my $parent = $self->parent or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 96 | 0 | $self->parent->manager; | |||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | sub topfolder() | ||||||||||||||||||||||||||||
| 102 | 11 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
topfolder: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 103 | 11 | ▶ | my $parent = $self->parent or return $self; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | 7 | $parent->parent->topfolder; | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | sub onlySubfolders(;$) | ||||||||||||||||||||||||||||
| 110 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
onlySubfolders: called CC=4 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 111 | 1 | ▶ | return($self->{MBI_only_subs} = shift) if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 112 | 1 | ▶ | return $self->{MBI_only_subs} if exists $self->{MBI_only_subs}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | 0 | ▶ | $self->parent ? 1 : ! $self->folderType->topFolderWithMessages; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | sub marked(;$) | ||||||||||||||||||||||||||||
| 119 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
marked: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 120 | 0 | ▶ | @_ ? ($self->{MBI_marked} = shift) : $self->{MBI_marked}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | sub inferiors(;$) | ||||||||||||||||||||||||||||
| 126 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
inferiors: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||
| 127 | 1 | ▶ | @_ ? ($self->{MBI_inferiors} = shift) : $self->{MBI_inferiors}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | sub deleted(;$) | ||||||||||||||||||||||||||||
| 133 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
deleted: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | @_ ? ($self->{MBI_deleted} = shift) : $self->{MBI_deleted}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | #-------------------- | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | sub subfolders() | ||||||||||||||||||||||||||||
| 140 | 54 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
subfolders: called CC=10 SCAR=25.0
Pod
documented
| |||||||||||||||||||||||||||||
| 141 | 54 | my $subs = $self->collection('subfolders'); | |||||||||||||||||||||||||||
| 142 | 54 | ▶ | return (wantarray ? $subs->roles : $subs) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 143 | if defined $subs; | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | 22 | my @subs; | |||||||||||||||||||||||||||
| 146 | 22 | ▶ | if(my $location = $self->location) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 147 | 22 | { @subs = $self->folderType->listSubFolders(folder => $location); | |||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||
| 149 | else | ||||||||||||||||||||||||||||
| 150 | 0 | { my $mgr = $self->manager; | |||||||||||||||||||||||||||
| 151 | 0 | ▶ | my $top = defined $mgr ? $mgr->folderdir : '.'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 152 | 0 | @subs = $self->folderType->listSubFolders(folder => $self->fullname, folderdir => $top); | |||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||
| 154 | 22 | ▶ | @subs or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 4 | ▶ | my $subf_type = $self->{MBI_subf_type} || ref($self->parent) || 'Mail::Box::Collection'; | ||||||||||||||||||||||||||
|
Condition40%2/5
$self->{'MBI_subf_type'} || ref $self->parent || 'Mail::Box::Collection'
$self->{"MBI_subf_type"} or ref $self->parent
MC/DC0%0/2
$self->{'MBI_subf_type'} || ref $self->parent || 'Mail::Box::Collection'
$self->{"MBI_subf_type"}
ref $self->parent
Truth table33%1/3
A or B
A= $self->{"MBI_subf_type"}B= ref $self->parent
| |||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | 4 | $subs = $subf_type->new('subfolders'); | |||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | 4 | $self->addCollection($subs); | |||||||||||||||||||||||||||
| 161 | 4 | $subs->addRole(name => $_) for @subs; | |||||||||||||||||||||||||||
| 162 | 4 | ▶ | wantarray ? $subs->roles : $subs; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | 3 | ▶ | sub subfolderNames() { map $_->name, $_[0]->subfolders } | ||||||||||||||||||||||||||
|
Subroutine
subfolderNames: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | sub folder(@) | ||||||||||||||||||||||||||||
| 172 | 30 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
folder: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 173 | 30 | ▶ | return $self unless @_ && defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and defined $_[0]
MC/DC50%1/2
@_ and defined $_[0]
@_
defined $_[0]
Truth table66%2/3
A and B
A= @_B= defined $_[0]
| |||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | 22 | ▶ | my $subs = $self->subfolders or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 176 | 21 | ▶ | my $nest = $subs->find(shift) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | 19 | $nest->folder(@_); | |||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | sub open(@) | ||||||||||||||||||||||||||||
| 182 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
open: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 183 | 0 | $self->manager->open($self->fullname, type => $self->folderType, @_); | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | sub foreach($) | ||||||||||||||||||||||||||||
| 188 | 24 | ▶ | { my ($self, $code) = @_; | ||||||||||||||||||||||||||
|
Subroutine
foreach: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 189 | 24 | $code->($self); | |||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | 24 | ▶ | my $subs = $self->subfolders or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | 8 | $_->foreach($code) for $subs->sorted; | |||||||||||||||||||||||||||
| 193 | 8 | $self; | |||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | sub addSubfolder(@) | ||||||||||||||||||||||||||||
| 199 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
addSubfolder: called CC=3 SCAR=12.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 200 | 1 | my $subs = $self->subfolders; | |||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | 1 | ▶ | if(defined $subs) { ; } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 203 | elsif(!$self->inferiors) | ||||||||||||||||||||||||||||
| 204 | 0 | { my $name = $self->fullname; | |||||||||||||||||||||||||||
| 205 | 0 | error __x"it is not permitted to add subfolders to {folder}.", folder => $name; | |||||||||||||||||||||||||||
| 206 | 0 | return undef; | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | else | ||||||||||||||||||||||||||||
| 209 | 1 | { $subs = $self->{MBI_subf_type}->new('subfolders'); | |||||||||||||||||||||||||||
| 210 | 1 | $self->addCollection($subs); | |||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 1 | $subs->addRole(@_); | |||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||
| 218 | sub remove(;$) | ||||||||||||||||||||||||||||
| 219 | 2 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
remove: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | 2 | ▶ | my $parent = $self->parent | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 222 | or error __x"the toplevel folder cannot be removed this way."; | ||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | 2 | ▶ | @_ or return $parent->removeRole($self->name); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 1 | my $name = shift; | |||||||||||||||||||||||||||
| 227 | 1 | ▶ | my $subs = $self->subfolders or return (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 228 | 1 | $subs->removeRole($name); | |||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | sub rename($;$) | ||||||||||||||||||||||||||||
| 233 | 1 | ▶ | { my ($self, $folder, $newname) = @_; | ||||||||||||||||||||||||||
|
Subroutine
rename: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||
| 234 | 1 | ▶ | $newname //= $self->name; | ||||||||||||||||||||||||||
|
Condition33%1/3
$newname //= $self->name
MC/DC0%0/2
$newname //= $self->name
$newname
$self->name
Truth table33%1/3
A //= B
A= $newnameB= $self->name
| |||||||||||||||||||||||||||||
| 235 | 1 | my $away = $self->remove; | |||||||||||||||||||||||||||
| 236 | 1 | $away->name($newname); | |||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | 1 | $folder->addSubfolder($away); | |||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | 3 | 1; | |||||||||||||||||||||||||||