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
|
|
1667
|
use strict; |
|
27
|
|
|
|
|
55
|
|
|
27
|
|
|
|
|
799
|
|
6
|
27
|
|
|
27
|
|
135
|
use warnings; |
|
27
|
|
|
|
|
49
|
|
|
27
|
|
|
|
|
1060
|
|
7
|
|
|
|
|
|
|
our $VERSION = '2.20210915'; # VERSION |
8
|
27
|
|
|
27
|
|
141
|
use Scalar::Util qw{ weaken }; |
|
27
|
|
|
|
|
53
|
|
|
27
|
|
|
|
|
1098
|
|
9
|
27
|
|
|
27
|
|
139
|
use Carp; |
|
27
|
|
|
|
|
46
|
|
|
27
|
|
|
|
|
1722
|
|
10
|
|
|
|
|
|
|
|
11
|
27
|
|
|
27
|
|
170
|
use base 'Mail::AuthenticationResults::Header::Base'; |
|
27
|
|
|
|
|
49
|
|
|
27
|
|
|
|
|
10568
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
35
|
|
|
35
|
|
1865
|
sub _HAS_VALUE{ return 1; } |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub build_string { |
17
|
10
|
|
|
10
|
1
|
24
|
my ( $self, $header ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
10
|
100
|
|
|
|
48
|
if ( ! $self->value() ) { |
20
|
1
|
|
|
|
|
3
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
9
|
100
|
|
|
|
39
|
if ( ref $self->parent() ne 'Mail::AuthenticationResults::Header::AuthServID' ) { |
24
|
6
|
|
|
|
|
24
|
$header->separator( '/' ); |
25
|
6
|
|
|
|
|
32
|
$header->space( ' ' ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
9
|
|
|
|
|
26
|
$header->string( $self->value() ); |
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
20
|
return; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub safe_set_value { |
34
|
3
|
|
|
3
|
1
|
105
|
my ( $self, $value ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
3
|
100
|
|
|
|
9
|
$value = 1 if ! defined $value; |
37
|
3
|
|
|
|
|
20
|
$value =~ s/[^0-9]//g; |
38
|
3
|
100
|
|
|
|
9
|
$value = 1 if $value eq q{}; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
8
|
$self->set_value( $value ); |
41
|
3
|
|
|
|
|
9
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub set_value { |
45
|
11
|
|
|
11
|
1
|
2092
|
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
|
|
|
|
41
|
croak 'Value cannot be undefined' if ! defined $value; |
50
|
10
|
100
|
|
|
|
59
|
croak 'Value must be numeric' if $value =~ /[^0-9]/; |
51
|
|
|
|
|
|
|
|
52
|
8
|
|
|
|
|
36
|
$self->{ 'value' } = $value; |
53
|
8
|
|
|
|
|
24
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |