« blib/lib/Rose/HTML/Form/Field/Time/Hours.pm
↑ Summary
blib/lib/Rose/HTML/Object/Message/Localizer.pm »
| 1 | package Rose::HTML::Object::MakeMethods::Localization; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 43 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 43 | ▶ | use Carp(); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 43 | ▶ | use base 'Rose::Object::MakeMethods'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 43 | our $VERSION = '0.615'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub localized_message | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 153 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
localized_message: called CC=6 SCAR=22.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 153 | my($class, $name, $args, $opts) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 153 | my %methods; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 153 | ▶ | my $interface = $args->{'interface'} || 'get_set'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'interface'} || 'get_set'
MC/DC0%0/1
$args->{'interface'} || 'get_set'
$args->{'interface'}
Truth table50%1/2
A
A= $args->{'interface'}
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 153 | ▶ | my $key = $args->{'hash_key'} || $name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{'hash_key'} || $name
MC/DC0%0/2
$args->{'hash_key'} || $name
$args->{'hash_key'}
$name
Truth table33%1/3
A || B
A= $args->{'hash_key'}B= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 153 | ▶ | my $id_method = $args->{'msg_id_method'} || $key . '_message_id'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'msg_id_method'} || $key . '_message_id'
MC/DC0%0/1
$args->{'msg_id_method'} || $key . '_message_id'
$args->{'msg_id_method'}
Truth table50%1/2
A
A= $args->{'msg_id_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 153 | ▶ | my $accept_msg_class = $args->{'accept_msg_class'} || 'Rose::HTML::Object::Message'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'accept_msg_class'} || 'Rose::HTML::Object::Message'
MC/DC0%0/1
$args->{'accept_msg_class'} || 'Rose::HTML::Object::Message'
$args->{'accept_msg_class'}
Truth table50%1/2
A
A= $args->{'accept_msg_class'}
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 153 | require Rose::HTML::Object::Message::Localized; | |||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 153 | ▶ | if($interface eq 'get_set') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | $methods{$name} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 2206 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=8 SCAR=29.6
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 2206 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 2206 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | { | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 853 | ▶ | if(@_ > 1) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | { | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my($id) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my @args; | |||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | if(@_ == 1 && ref($_[0]) =~ /^(?:HASH|ARRAY)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
MC/DC0%0/2
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
@_ == 1
ref($_[0]) =~ /^(?:HASH|ARRAY)$/
Truth table0%0/3
A and B
A= @_ == 1B= ref($_[0]) =~ /^(?:HASH|ARRAY)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | @args = (args => $_[0]); | |||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | else | ||||||||||||||||||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | @args = (args => [ @_ ]); | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | unless($id =~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | $id = $self->localizer->get_message_id($id) || | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->localizer->get_message_id($id) || Carp::croak("Unknown message id: '${id}'")
MC/DC0%0/1
$self->localizer->get_message_id($id) || Carp::croak("Unknown message id: '${id}'")
$self->localizer->get_message_id($id)
Truth table0%0/2
A
A= $self->localizer->get_message_id($id)
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | Carp::croak "Unknown message id: '$id'"; | ||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | return $self->$name($self->localizer->message_class->new(id => $id, parent => $self, @args)); | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 853 | my $msg = shift; | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 853 | ▶ | if(UNIVERSAL::isa($msg, $accept_msg_class)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | { | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 483 | $msg->parent($self); | |||||||||||||||||||||||||||||||||||||||||
| 62 | 483 | return $self->{$key} = $msg; | |||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||
| 64 | else | ||||||||||||||||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 370 | return $self->{$key} = $self->localizer->message_class->new(text => $msg, parent => $self); | |||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 1353 | return $self->{$key}; | |||||||||||||||||||||||||||||||||||||||||
| 71 | 153 | }; | |||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | $methods{$id_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 363 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=16.6
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 363 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | 363 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 363 | my($id, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 80 | 363 | ▶ | return $self->$name(undef) unless(defined $id); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 349 | return $self->$name($self->localizer->message_class->new(id => $id, args => \@args, parent => $self)); | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | my $error = $self->$name(); | |||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | return $error->id if(UNIVERSAL::can($error, 'id')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 87 | 153 | }; | |||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | else { Carp::croak "Unknown interface: $interface" } | |||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 153 | return \%methods; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | sub localized_error | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
localized_error: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my($class, $name, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | my %methods; | |||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | my $interface = $args->{'interface'} || 'get_set'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'interface'} || 'get_set'
MC/DC0%0/1
$args->{'interface'} || 'get_set'
$args->{'interface'}
Truth table0%0/2
A
A= $args->{'interface'}
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | my $key = $args->{'hash_key'} || $name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args->{'hash_key'} || $name
MC/DC0%0/2
$args->{'hash_key'} || $name
$args->{'hash_key'}
$name
Truth table0%0/3
A || B
A= $args->{'hash_key'}B= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | my $id_method = $args->{'error_id_method'} || $key . '_id'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'error_id_method'} || $key . '_id'
MC/DC0%0/1
$args->{'error_id_method'} || $key . '_id'
$args->{'error_id_method'}
Truth table0%0/2
A
A= $args->{'error_id_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | my $accept_error_class = $args->{'accept_error_class'} || 'Rose::HTML::Object::Error'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{'accept_error_class'} || 'Rose::HTML::Object::Error'
MC/DC0%0/1
$args->{'accept_error_class'} || 'Rose::HTML::Object::Error'
$args->{'accept_error_class'}
Truth table0%0/2
A
A= $args->{'accept_error_class'}
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | require Rose::HTML::Object::Error; | |||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if($interface eq 'get_set') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | $methods{$name} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=12 SCAR=50.5
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | { | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | return $self->{$key} = undef unless(defined $_[0]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if(@_ > 1) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | my($id) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | my @args; | |||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | if(@_ == 1 && ref($_[0]) =~ /^(?:HASH|ARRAY)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
MC/DC0%0/2
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
@_ == 1
ref($_[0]) =~ /^(?:HASH|ARRAY)$/
Truth table0%0/3
A and B
A= @_ == 1B= ref($_[0]) =~ /^(?:HASH|ARRAY)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | { | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | @args = (args => $_[0]); | |||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | else | ||||||||||||||||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | @args = (args => [ @_ ]); | |||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | unless($id =~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | $id = $self->localizer->get_error_id($id) || | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->localizer->get_error_id($id) || Carp::croak("Attempt to call $name() with more than one ", 'argument, and the first argument is not a numeric ', "error id: '${id}'")
MC/DC0%0/1
$self->localizer->get_error_id($id) || Carp::croak("Attempt to call $name() with more than one ", 'argument, and the first argument is not a numeric ', "error id: '${id}'")
$self->localizer->get_error_id($id)
Truth table0%0/2
A
A= $self->localizer->get_error_id($id)
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | Carp::croak "Attempt to call $name() with more than one ", | ||||||||||||||||||||||||||||||||||||||||||
| 139 | "argument, and the first argument is not a numeric ", | ||||||||||||||||||||||||||||||||||||||||||
| 140 | "error id: '$id'"; | ||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | unshift(@args, error_id => $id); | |||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my $message; | |||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | if($self->can('message_for_error_id')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 148 | { | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | $message = $self->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | unless(defined $message) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | { | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | else | ||||||||||||||||||||||||||||||||||||||||||
| 157 | { | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | return $self->$name($localizer->error_class->new(id => $id, | |||||||||||||||||||||||||||||||||||||||||
| 163 | parent => $self, | ||||||||||||||||||||||||||||||||||||||||||
| 164 | message => $message)); | ||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | my $error = shift; | |||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if(UNIVERSAL::isa($error, $accept_error_class)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | { | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $error->parent($self); | |||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | return $self->{$key} = $error; | |||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | elsif(defined $error) | ||||||||||||||||||||||||||||||||||||||||||
| 175 | { | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | return $self->{$key} = | |||||||||||||||||||||||||||||||||||||||||
| 177 | $localizer->error_class->new(message => $localizer->messsage_class->new($error), | ||||||||||||||||||||||||||||||||||||||||||
| 178 | parent => $self); | ||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | return $self->{$key}; | |||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | $methods{$id_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my($id) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | my @args; | |||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | if(@_ == 1 && ref($_[0]) =~ /^(?:HASH|ARRAY)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
MC/DC0%0/2
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
@_ == 1
ref($_[0]) =~ /^(?:HASH|ARRAY)$/
Truth table0%0/3
A and B
A= @_ == 1B= ref($_[0]) =~ /^(?:HASH|ARRAY)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | { | ||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | @args = (args => $_[0]); | |||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||
| 201 | else | ||||||||||||||||||||||||||||||||||||||||||
| 202 | { | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | @args = (args => [ @_ ]); | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | unless($id =~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | { | ||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | $id = $localizer->get_error_id($id) || | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$localizer->get_error_id($id) || Carp::croak("Unknown error id: '${id}'")
MC/DC0%0/1
$localizer->get_error_id($id) || Carp::croak("Unknown error id: '${id}'")
$localizer->get_error_id($id)
Truth table0%0/2
A
A= $localizer->get_error_id($id)
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | Carp::croak "Unknown error id: '$id'"; | ||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | unshift(@args, error_id => $id); | |||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my $message; | |||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if($self->can('message_for_error_id')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 217 | { | ||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | $message = $self->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | unless(defined $message) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | { | ||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||
| 225 | else | ||||||||||||||||||||||||||||||||||||||||||
| 226 | { | ||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | return $self->$name($localizer->error_class->new(id => $id, | |||||||||||||||||||||||||||||||||||||||||
| 232 | parent => $self, | ||||||||||||||||||||||||||||||||||||||||||
| 233 | message => $message)); | ||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my $error = $self->$name(); | |||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | return $error->id if(UNIVERSAL::can($error, 'id')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | else { Carp::croak "Unknown interface: $interface" } | |||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | return \%methods; | |||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||
| 247 | sub localized_errors | ||||||||||||||||||||||||||||||||||||||||||
| 248 | 43 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
localized_errors: called CC=15 SCAR=30.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 249 | 43 | my($class, $name, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 43 | my %methods; | |||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | 43 | ▶ | my $interface = $args->{'interface'} || 'get_set'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'interface'} || 'get_set'
MC/DC0%0/1
$args->{'interface'} || 'get_set'
$args->{'interface'}
Truth table50%1/2
A
A= $args->{'interface'}
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | 43 | ▶ | my $key = $args->{'hash_key'} || $name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{'hash_key'} || $name
MC/DC0%0/2
$args->{'hash_key'} || $name
$args->{'hash_key'}
$name
Truth table33%1/3
A || B
A= $args->{'hash_key'}B= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | 43 | ▶ | my $plural_name = $args->{'plural_name'} || $name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{'plural_name'} || $name
MC/DC0%0/2
$args->{'plural_name'} || $name
$args->{'plural_name'}
$name
Truth table33%1/3
A || B
A= $args->{'plural_name'}B= $name
| |||||||||||||||||||||||||||||||||||||||||||
| 256 | 43 | ▶ | my $singular_name = $args->{'singular_name'} || plural_to_singular($plural_name); | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{'singular_name'} || plural_to_singular($plural_name)
MC/DC0%0/2
$args->{'singular_name'} || plural_to_singular($plural_name)
$args->{'singular_name'}
plural_to_singular($plural_name)
Truth table33%1/3
A || B
A= $args->{'singular_name'}B= plural_to_singular($plural_name)
| |||||||||||||||||||||||||||||||||||||||||||
| 257 | 43 | ▶ | my $has_method = $args->{'has_error_method'} || 'has_' . $plural_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'has_error_method'} || 'has_' . $plural_name
MC/DC0%0/1
$args->{'has_error_method'} || 'has_' . $plural_name
$args->{'has_error_method'}
Truth table50%1/2
A
A= $args->{'has_error_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | 43 | ▶ | my $has_method2 = $args->{'has_errors_method'} || 'has_' . $singular_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'has_errors_method'} || 'has_' . $singular_name
MC/DC0%0/1
$args->{'has_errors_method'} || 'has_' . $singular_name
$args->{'has_errors_method'}
Truth table50%1/2
A
A= $args->{'has_errors_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 43 | ▶ | my $add_method = $args->{'add_error_method'} || 'add_' . $singular_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'add_error_method'} || 'add_' . $singular_name
MC/DC0%0/1
$args->{'add_error_method'} || 'add_' . $singular_name
$args->{'add_error_method'}
Truth table50%1/2
A
A= $args->{'add_error_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 43 | ▶ | my $adds_method = $args->{'add_errors_method'} || 'add_' . $plural_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'add_errors_method'} || 'add_' . $plural_name
MC/DC0%0/1
$args->{'add_errors_method'} || 'add_' . $plural_name
$args->{'add_errors_method'}
Truth table50%1/2
A
A= $args->{'add_errors_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 43 | ▶ | my $id_method = $args->{'error_id_method'} || $singular_name . '_id'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'error_id_method'} || $singular_name . '_id'
MC/DC0%0/1
$args->{'error_id_method'} || $singular_name . '_id'
$args->{'error_id_method'}
Truth table50%1/2
A
A= $args->{'error_id_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | 43 | ▶ | my $ids_method = $args->{'error_ids_method'} || $singular_name . '_ids'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'error_ids_method'} || $singular_name . '_ids'
MC/DC0%0/1
$args->{'error_ids_method'} || $singular_name . '_ids'
$args->{'error_ids_method'}
Truth table50%1/2
A
A= $args->{'error_ids_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | 43 | ▶ | my $add_id_method = $args->{'add_error_id_method'} || 'add_' . $singular_name . '_id'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'add_error_id_method'} || 'add_' . $singular_name . '_id'
MC/DC0%0/1
$args->{'add_error_id_method'} || 'add_' . $singular_name . '_id'
$args->{'add_error_id_method'}
Truth table50%1/2
A
A= $args->{'add_error_id_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 264 | 43 | ▶ | my $add_ids_method = $args->{'add_error_ids_method'} || 'add_' . $singular_name . '_ids'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'add_error_ids_method'} || 'add_' . $singular_name . '_ids'
MC/DC0%0/1
$args->{'add_error_ids_method'} || 'add_' . $singular_name . '_ids'
$args->{'add_error_ids_method'}
Truth table50%1/2
A
A= $args->{'add_error_ids_method'}
| |||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||
| 266 | 43 | ▶ | my $accept_error_class = $args->{'accept_error_class'} || 'Rose::HTML::Object::Error'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args->{'accept_error_class'} || 'Rose::HTML::Object::Error'
MC/DC0%0/1
$args->{'accept_error_class'} || 'Rose::HTML::Object::Error'
$args->{'accept_error_class'}
Truth table50%1/2
A
A= $args->{'accept_error_class'}
| |||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | 43 | require Rose::HTML::Object::Error; | |||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||
| 270 | 43 | ▶ | if($interface eq 'get_set') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | { | ||||||||||||||||||||||||||||||||||||||||||
| 272 | $methods{$plural_name} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 273 | 19 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||
| 274 | 19 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||
| 276 | 19 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 277 | { | ||||||||||||||||||||||||||||||||||||||||||
| 278 | 8 | ▶ | if(!defined $_[0] || (ref $_[0] eq 'ARRAY' && !@{$_[0]})) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not defined $_[0] or ref $_[0] eq "ARRAY" and not @{$_[0];}
ref $_[0] eq "ARRAY" and not @{$_[0];}
MC/DC66%2/3
not defined $_[0] or ref $_[0] eq "ARRAY" and not @{$_[0];}
not defined $_[0]
ref $_[0] eq "ARRAY"
not @{$_[0];}
Truth table75%3/4
not(A) or B and not(C)
A= not defined $_[0]B= ref $_[0] eq "ARRAY"C= not @{$_[0];}
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 2 | return $self->{$key} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||
| 283 | 6 | $self->{$key} = undef; | |||||||||||||||||||||||||||||||||||||||||
| 284 | 6 | $self->$adds_method(@_); | |||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||
| 287 | 17 | ▶ | return wantarray ? @{$self->{$key} || []} : $self->{$key}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->{$key} || []
MC/DC0%0/1
$self->{$key} || []
$self->{$key}
Truth table50%1/2
A
A= $self->{$key}
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||
| 290 | $methods{$singular_name} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 291 | 6423 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=12 SCAR=27.7
| |||||||||||||||||||||||||||||||||||||||||||
| 292 | 6423 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | 6423 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 295 | { | ||||||||||||||||||||||||||||||||||||||||||
| 296 | 4442 | ▶ | return $self->{$key} = undef unless(defined $_[0]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | 20 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||
| 300 | 20 | ▶ | if(@_ > 1) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 301 | { | ||||||||||||||||||||||||||||||||||||||||||
| 302 | 2 | my($id) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||
| 304 | 2 | my @args; | |||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | 2 | ▶ | if(@_ == 1 && ref($_[0]) =~ /^(?:HASH|ARRAY)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
MC/DC0%0/2
@_ == 1 and ref($_[0]) =~ /^(?:HASH|ARRAY)$/
@_ == 1
ref($_[0]) =~ /^(?:HASH|ARRAY)$/
Truth table33%1/3
A and B
A= @_ == 1B= ref($_[0]) =~ /^(?:HASH|ARRAY)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | { | ||||||||||||||||||||||||||||||||||||||||||
| 308 | 2 | @args = (args => $_[0]); | |||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||
| 310 | else | ||||||||||||||||||||||||||||||||||||||||||
| 311 | { | ||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | @args = (args => [ @_ ]); | |||||||||||||||||||||||||||||||||||||||||
| 313 | } | ||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | 2 | ▶ | unless($id =~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 316 | { | ||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $id = $localizer->get_error_id($id) || | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$localizer->get_error_id($id) || Carp::croak("Attempt to call $singular_name() with more than one ", 'argument, and the first argument is not a numeric ', "error id: '${id}'")
MC/DC0%0/1
$localizer->get_error_id($id) || Carp::croak("Attempt to call $singular_name() with more than one ", 'argument, and the first argument is not a numeric ', "error id: '${id}'")
$localizer->get_error_id($id)
Truth table0%0/2
A
A= $localizer->get_error_id($id)
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | Carp::croak "Attempt to call $singular_name() with more than one ", | ||||||||||||||||||||||||||||||||||||||||||
| 319 | "argument, and the first argument is not a numeric ", | ||||||||||||||||||||||||||||||||||||||||||
| 320 | "error id: '$id'"; | ||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||
| 323 | 2 | unshift(@args, error_id => $id); | |||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | 2 | my $message; | |||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | 2 | ▶ | if($self->can('message_for_error_id')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 328 | { | ||||||||||||||||||||||||||||||||||||||||||
| 329 | 2 | $message = $self->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||||||||||||||||
| 331 | 2 | ▶ | unless(defined $message) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 332 | { | ||||||||||||||||||||||||||||||||||||||||||
| 333 | 2 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||||||||||
| 336 | else | ||||||||||||||||||||||||||||||||||||||||||
| 337 | { | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | $message = $localizer->message_for_error_id(@args); | |||||||||||||||||||||||||||||||||||||||||
| 339 | } | ||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||
| 341 | 2 | $self->{$key} = | |||||||||||||||||||||||||||||||||||||||||
| 342 | [ $localizer->error_class->new(id => $id, parent => $self, message => $message) ]; | ||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||
| 344 | 2 | return $self->{$key}[-1]; | |||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||
| 347 | 18 | my $error = shift; | |||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||
| 349 | 18 | ▶ | if(UNIVERSAL::isa($error, $accept_error_class)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 350 | { | ||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | $error->parent($self); | |||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | $self->{$key} = [ $error ]; | |||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||
| 354 | elsif(defined $error) | ||||||||||||||||||||||||||||||||||||||||||
| 355 | { | ||||||||||||||||||||||||||||||||||||||||||
| 356 | 18 | $self->{$key} = | |||||||||||||||||||||||||||||||||||||||||
| 357 | [ $localizer->error_class->new(message => $localizer->message_class->new($error), parent => $self) ]; | ||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||
| 361 | 1999 | return $self->{$key}[-1]; | |||||||||||||||||||||||||||||||||||||||||
| 362 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||
| 364 | $methods{$adds_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 365 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||
| 366 | 7 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||
| 368 | 7 | ▶ | return unless(@_); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||
| 370 | 7 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 371 | 7 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 0, 0); | |||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 7 | push(@{$self->{$key}}, @$errors); | |||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||
| 375 | 7 | ▶ | return wantarray ? @$errors : $errors; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 376 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||
| 378 | $methods{$add_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 379 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||
| 380 | 5 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||
| 382 | 5 | ▶ | return unless(@_); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||||||||||
| 384 | 5 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 385 | 5 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 0, 1); | |||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||
| 387 | 5 | push(@{$self->{$key}}, @$errors); | |||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||
| 389 | 5 | ▶ | return wantarray ? @$errors : $errors; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 390 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||||||||||
| 392 | $methods{$id_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 393 | 43 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 394 | 43 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||
| 396 | 43 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 397 | { | ||||||||||||||||||||||||||||||||||||||||||
| 398 | 32 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 399 | 32 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 1, 1); | |||||||||||||||||||||||||||||||||||||||||
| 400 | 32 | $self->{$key} = $errors; | |||||||||||||||||||||||||||||||||||||||||
| 401 | 32 | return $errors->[-1]->id; | |||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||
| 404 | 11 | ▶ | return $self->{$key}[-1] ? $self->{$key}[-1]->id : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 405 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||
| 407 | $methods{$ids_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 408 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=23.5
| |||||||||||||||||||||||||||||||||||||||||||
| 409 | 1 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||
| 411 | 1 | ▶ | if(@_) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 412 | { | ||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 1, 0); | |||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | $self->{$key} = $errors; | |||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | return wantarray ? @$errors : $errors; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 417 | } | ||||||||||||||||||||||||||||||||||||||||||
| 418 | |||||||||||||||||||||||||||||||||||||||||||
| 419 | 1 | ▶ | if(defined(my $want = wantarray)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 420 | { | ||||||||||||||||||||||||||||||||||||||||||
| 421 | 1 | ▶ | my @ids = map { $_->id } @{$self->{$key} || []}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{$key} || []
MC/DC0%0/1
$self->{$key} || []
$self->{$key}
Truth table50%1/2
A
A= $self->{$key}
| |||||||||||||||||||||||||||||||||||||||||||
| 422 | 1 | ▶ | return $want ? @ids : \@ids; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||
| 424 | |||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 426 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||||||||||||||
| 428 | $methods{$add_ids_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 429 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=16.3
| |||||||||||||||||||||||||||||||||||||||||||
| 430 | 1 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||
| 432 | 1 | ▶ | return unless(@_); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||
| 434 | 1 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 435 | 1 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 1, 1); | |||||||||||||||||||||||||||||||||||||||||
| 436 | |||||||||||||||||||||||||||||||||||||||||||
| 437 | 1 | push(@{$self->{$key}}, @$errors); | |||||||||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||||||||||
| 439 | 1 | ▶ | if(defined(my $want = wantarray)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 440 | { | ||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | my @ids = map { $_->id } @$errors; | |||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | ▶ | return $want ? @ids : \@ids; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 443 | } | ||||||||||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||||||||||
| 445 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 446 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||||||||||
| 448 | $methods{$add_id_method} = sub | ||||||||||||||||||||||||||||||||||||||||||
| 449 | 68 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=16.3
| |||||||||||||||||||||||||||||||||||||||||||
| 450 | 68 | my($self) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||
| 452 | 68 | ▶ | return unless(@_); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||||||||||||||||
| 454 | 68 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 455 | 68 | my $errors = __errors_from_args($self, \@_, $localizer->error_class, $localizer->message_class, $accept_error_class, 1, 0); | |||||||||||||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||||||||||||
| 457 | 68 | push(@{$self->{$key}}, @$errors); | |||||||||||||||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||||||||||||||||
| 459 | 68 | ▶ | if(defined(my $want = wantarray)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 460 | { | ||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | my @ids = map { $_->id } @$errors; | |||||||||||||||||||||||||||||||||||||||||
| 462 | 0 | ▶ | return $want ? @ids : \@ids; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||||||||||||||
| 465 | 68 | return; | |||||||||||||||||||||||||||||||||||||||||
| 466 | 43 | }; | |||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||
| 468 | 43 | ▶ | $methods{$has_method} = sub { scalar @{shift->{$key} || []} }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Condition100%2/2
+(shift())->{$key} || []
MC/DC100%1/1
+(shift())->{$key} || []
+(shift())->{$key}
Truth table100%2/2
A
A= +(shift())->{$key}
| |||||||||||||||||||||||||||||||||||||||||||
| 469 | 43 | $methods{$has_method2} = $methods{$has_method}; | |||||||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | else { Carp::croak "Unknown interface: $interface" } | |||||||||||||||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||||||||||||||||
| 473 | 43 | return \%methods; | |||||||||||||||||||||||||||||||||||||||||
| 474 | } | ||||||||||||||||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||||||||||||||||
| 476 | sub plural_to_singular | ||||||||||||||||||||||||||||||||||||||||||
| 477 | 43 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
plural_to_singular: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 478 | 43 | my($word) = shift; | |||||||||||||||||||||||||||||||||||||||||
| 479 | 43 | ▶ | return $word if($word =~ /[aeiouy]ss$/i); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 480 | 43 | $word =~ s/s$//; | |||||||||||||||||||||||||||||||||||||||||
| 481 | 43 | return $word; | |||||||||||||||||||||||||||||||||||||||||
| 482 | } | ||||||||||||||||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||||||||||||||||
| 484 | # Acceptable formats: | ||||||||||||||||||||||||||||||||||||||||||
| 485 | # | ||||||||||||||||||||||||||||||||||||||||||
| 486 | # <error object>, ... | ||||||||||||||||||||||||||||||||||||||||||
| 487 | # <numeric error id> (id method only) | ||||||||||||||||||||||||||||||||||||||||||
| 488 | # <list of numeric error ids> (non-singular id method only) | ||||||||||||||||||||||||||||||||||||||||||
| 489 | # <numeric error id> <list of args> (singular only) | ||||||||||||||||||||||||||||||||||||||||||
| 490 | # <numeric error id> <arrayref of args>, ... | ||||||||||||||||||||||||||||||||||||||||||
| 491 | # <numeric error id> <hashref of args>, ... | ||||||||||||||||||||||||||||||||||||||||||
| 492 | sub __errors_from_args | ||||||||||||||||||||||||||||||||||||||||||
| 493 | 113 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__errors_from_args: called CC=14 SCAR=26.9
| |||||||||||||||||||||||||||||||||||||||||||
| 494 | 113 | my($self, $args, $error_class, $msg_class, $accept_error_class, $id_method, $singular) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||||||||||||||||
| 496 | 113 | local $Carp::CarpLevel = 1; | |||||||||||||||||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||||||||||||||||
| 498 | 113 | ▶ | $args = $args->[0] if(@$args == 1 && ref($args->[0]) eq 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@$args == 1 and ref $args->[0] eq "ARRAY"
MC/DC0%0/2
@$args == 1 and ref $args->[0] eq "ARRAY"
@$args == 1
ref $args->[0] eq "ARRAY"
Truth table66%2/3
A and B
A= @$args == 1B= ref $args->[0] eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||||||||||||||||
| 500 | 113 | my @errors; | |||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||
| 502 | 113 | my $localizer = $self->localizer; | |||||||||||||||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||||||||||||||||
| 504 | 113 | ▶ | for(my $i = 0; $i <= $#$args; $i++) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 505 | { | ||||||||||||||||||||||||||||||||||||||||||
| 506 | 119 | my $arg = $args->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||||||||||||||||
| 508 | 119 | ▶ | if(UNIVERSAL::isa($arg, $accept_error_class)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 509 | { | ||||||||||||||||||||||||||||||||||||||||||
| 510 | 5 | $arg->parent($self); | |||||||||||||||||||||||||||||||||||||||||
| 511 | 5 | push(@errors, $arg); | |||||||||||||||||||||||||||||||||||||||||
| 512 | 5 | next; | |||||||||||||||||||||||||||||||||||||||||
| 513 | } | ||||||||||||||||||||||||||||||||||||||||||
| 514 | |||||||||||||||||||||||||||||||||||||||||||
| 515 | 114 | my $id = $arg; | |||||||||||||||||||||||||||||||||||||||||
| 516 | |||||||||||||||||||||||||||||||||||||||||||
| 517 | 114 | ▶ | if($id_method && $id !~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$id_method and not $id =~ /^\d+$/
MC/DC100%2/2
$id_method and not $id =~ /^\d+$/
$id_method
not $id =~ /^\d+$/
Truth table100%3/3
A and not(B)
A= $id_methodB= not $id =~ /^\d+$/
| |||||||||||||||||||||||||||||||||||||||||||
| 518 | { | ||||||||||||||||||||||||||||||||||||||||||
| 519 | 3 | ▶ | $id = $localizer->get_error_id($id) || | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$localizer->get_error_id($id) || Carp::croak("Unknown error id: '${id}'")
MC/DC0%0/1
$localizer->get_error_id($id) || Carp::croak("Unknown error id: '${id}'")
$localizer->get_error_id($id)
Truth table50%1/2
A
A= $localizer->get_error_id($id)
| |||||||||||||||||||||||||||||||||||||||||||
| 520 | Carp::croak "Unknown error id: '$id'"; | ||||||||||||||||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||||||||||||||
| 522 | |||||||||||||||||||||||||||||||||||||||||||
| 523 | 114 | my @msg_args; | |||||||||||||||||||||||||||||||||||||||||
| 524 | |||||||||||||||||||||||||||||||||||||||||||
| 525 | 114 | ▶ | if(ref($args->[$i + 1]) =~ /^(?:HASH|ARRAY)$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 526 | { | ||||||||||||||||||||||||||||||||||||||||||
| 527 | 57 | @msg_args = (args => $args->[++$i]); | |||||||||||||||||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||||||||||||||||
| 529 | ▶ | elsif($singular && ($i + 1) < $#$args) | |||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$singular and $i + 1 < $args->$#*
MC/DC0%0/2
$singular and $i + 1 < $args->$#*
$singular
$i + 1 < $args->$#*
Truth table66%2/3
A and B
A= $singularB= $i + 1 < $args->$#*
| |||||||||||||||||||||||||||||||||||||||||||
| 530 | { | ||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | @msg_args = (args => [ @$args[$i + 1 .. $#$args] ]); | |||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | $i = $#$args; | |||||||||||||||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||
| 535 | 114 | unshift(@msg_args, error_id => $id, msg_class => $msg_class); | |||||||||||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||||||||||||
| 537 | 114 | my $message; | |||||||||||||||||||||||||||||||||||||||||
| 538 | |||||||||||||||||||||||||||||||||||||||||||
| 539 | 114 | ▶ | if($id =~ /^\d+$/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 540 | { | ||||||||||||||||||||||||||||||||||||||||||
| 541 | 105 | ▶ | if($self->can('message_for_error_id')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 542 | { | ||||||||||||||||||||||||||||||||||||||||||
| 543 | 105 | $message = $self->message_for_error_id(@msg_args); | |||||||||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||||||||||
| 545 | 105 | ▶ | unless(defined $message) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 546 | { | ||||||||||||||||||||||||||||||||||||||||||
| 547 | 68 | $message = $localizer->message_for_error_id(@msg_args); | |||||||||||||||||||||||||||||||||||||||||
| 548 | } | ||||||||||||||||||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||||||||||||||||
| 550 | else | ||||||||||||||||||||||||||||||||||||||||||
| 551 | { | ||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | $message = $localizer->message_for_error_id(@msg_args); | |||||||||||||||||||||||||||||||||||||||||
| 553 | } | ||||||||||||||||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||||||||||||||||
| 555 | 105 | push(@errors, $error_class->new(id => $id, | |||||||||||||||||||||||||||||||||||||||||
| 556 | message => $message, | ||||||||||||||||||||||||||||||||||||||||||
| 557 | parent => $self)); | ||||||||||||||||||||||||||||||||||||||||||
| 558 | } | ||||||||||||||||||||||||||||||||||||||||||
| 559 | else | ||||||||||||||||||||||||||||||||||||||||||
| 560 | { | ||||||||||||||||||||||||||||||||||||||||||
| 561 | 9 | push(@errors, $error_class->new(message => $msg_class->new($id), | |||||||||||||||||||||||||||||||||||||||||
| 562 | parent => $self)); | ||||||||||||||||||||||||||||||||||||||||||
| 563 | } | ||||||||||||||||||||||||||||||||||||||||||
| 564 | } | ||||||||||||||||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||||||||||||||||
| 566 | 113 | return \@errors; | |||||||||||||||||||||||||||||||||||||||||
| 567 | } | ||||||||||||||||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||||||||||||||||
| 569 | 43 | 1; | |||||||||||||||||||||||||||||||||||||||||