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
|
27
|
|
|
27
|
|
1828
|
use strict; |
|
27
|
|
|
|
|
55
|
|
|
27
|
|
|
|
|
787
|
|
6
|
27
|
|
|
27
|
|
131
|
use warnings; |
|
27
|
|
|
|
|
49
|
|
|
27
|
|
|
|
|
1219
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20210914'; # VERSION |
8
|
27
|
|
|
27
|
|
154
|
use Scalar::Util qw{ weaken }; |
|
27
|
|
|
|
|
60
|
|
|
27
|
|
|
|
|
1224
|
|
9
|
27
|
|
|
27
|
|
234
|
use Carp; |
|
27
|
|
|
|
|
49
|
|
|
27
|
|
|
|
|
1470
|
|
10
|
|
|
|
|
|
|
|
11
|
27
|
|
|
27
|
|
171
|
use base 'Mail::AuthenticationResults::Header::Base'; |
|
27
|
|
|
|
|
52
|
|
|
27
|
|
|
|
|
11162
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
35
|
|
|
35
|
|
1862
|
sub _HAS_VALUE{ return 1; } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub build_string { |
17
|
10
|
|
|
10
|
1
|
29
|
my ( $self, $header ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
10
|
100
|
|
|
|
49
|
if ( ! $self->value() ) { |
20
|
1
|
|
|
|
|
3
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
9
|
100
|
|
|
|
42
|
if ( ref $self->parent() ne 'Mail::AuthenticationResults::Header::AuthServID' ) { |
24
|
6
|
|
|
|
|
19
|
$header->separator( '/' ); |
25
|
6
|
|
|
|
|
36
|
$header->space( ' ' ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
9
|
|
|
|
|
31
|
$header->string( $self->value() ); |
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
21
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub safe_set_value { |
34
|
3
|
|
|
3
|
1
|
111
|
my ( $self, $value ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
3
|
100
|
|
|
|
9
|
$value = 1 if ! defined $value; |
37
|
3
|
|
|
|
|
20
|
$value =~ s/[^0-9]//g; |
38
|
3
|
100
|
|
|
|
10
|
$value = 1 if $value eq q{}; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
9
|
$self->set_value( $value ); |
41
|
3
|
|
|
|
|
10
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub set_value { |
45
|
11
|
|
|
11
|
1
|
2158
|
my ( $self, $value ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
11
|
50
|
|
|
|
27
|
croak 'Does not have value' if ! $self->_HAS_VALUE(); # uncoverable branch true |
48
|
|
|
|
|
|
|
# HAS_VALUE is 1 for this class |
49
|
11
|
100
|
|
|
|
38
|
croak 'Value cannot be undefined' if ! defined $value; |
50
|
10
|
100
|
|
|
|
66
|
croak 'Value must be numeric' if $value =~ /[^0-9]/; |
51
|
|
|
|
|
|
|
|
52
|
8
|
|
|
|
|
39
|
$self->{ 'value' } = $value; |
53
|
8
|
|
|
|
|
24
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |