line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::AuthenticationResults::Header::Version; |
2
|
|
|
|
|
|
|
# ABSTRACT: Class modelling the AuthServID part of the Authentication Results Header |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require 5.008; |
5
|
28
|
|
|
28
|
|
1821
|
use strict; |
|
28
|
|
|
|
|
94
|
|
|
28
|
|
|
|
|
812
|
|
6
|
28
|
|
|
28
|
|
168
|
use warnings; |
|
28
|
|
|
|
|
50
|
|
|
28
|
|
|
|
|
1137
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20230112'; # VERSION |
8
|
28
|
|
|
28
|
|
161
|
use Scalar::Util qw{ weaken }; |
|
28
|
|
|
|
|
74
|
|
|
28
|
|
|
|
|
1169
|
|
9
|
28
|
|
|
28
|
|
169
|
use Carp; |
|
28
|
|
|
|
|
58
|
|
|
28
|
|
|
|
|
1667
|
|
10
|
|
|
|
|
|
|
|
11
|
28
|
|
|
28
|
|
192
|
use base 'Mail::AuthenticationResults::Header::Base'; |
|
28
|
|
|
|
|
62
|
|
|
28
|
|
|
|
|
11225
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
35
|
|
|
35
|
|
2157
|
sub _HAS_VALUE{ return 1; } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub build_string { |
17
|
10
|
|
|
10
|
1
|
37
|
my ( $self, $header ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
10
|
100
|
|
|
|
39
|
if ( ! $self->value() ) { |
20
|
1
|
|
|
|
|
2
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
9
|
100
|
|
|
|
47
|
if ( ref $self->parent() ne 'Mail::AuthenticationResults::Header::AuthServID' ) { |
24
|
6
|
|
|
|
|
44
|
$header->separator( '/' ); |
25
|
6
|
|
|
|
|
16
|
$header->space( ' ' ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
9
|
|
|
|
|
28
|
$header->string( $self->value() ); |
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
39
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub safe_set_value { |
34
|
3
|
|
|
3
|
1
|
141
|
my ( $self, $value ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
3
|
100
|
|
|
|
8
|
$value = 1 if ! defined $value; |
37
|
3
|
|
|
|
|
114
|
$value =~ s/[^0-9]//g; |
38
|
3
|
100
|
|
|
|
11
|
$value = 1 if $value eq q{}; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
12
|
$self->set_value( $value ); |
41
|
3
|
|
|
|
|
12
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub set_value { |
45
|
11
|
|
|
11
|
1
|
2556
|
my ( $self, $value ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
11
|
50
|
|
|
|
29
|
croak 'Does not have value' if ! $self->_HAS_VALUE(); # uncoverable branch true |
48
|
|
|
|
|
|
|
# HAS_VALUE is 1 for this class |
49
|
11
|
100
|
|
|
|
52
|
croak 'Value cannot be undefined' if ! defined $value; |
50
|
10
|
100
|
|
|
|
61
|
croak 'Value must be numeric' if $value =~ /[^0-9]/; |
51
|
|
|
|
|
|
|
|
52
|
8
|
|
|
|
|
56
|
$self->{ 'value' } = $value; |
53
|
8
|
|
|
|
|
22
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |