blib/lib/Mail/DMARC/Result/Reason.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 51 CC 5 SCAR 17.6
CC
5
Cov
0%
type
12.0
new
6.0
comment
6.0
CRAP 5.8
1 package Mail::DMARC::Result::Reason;
2 our $VERSION = '2.20260827';
3 use strict;
4 use warnings;
5 use feature 'signatures';
6 no warnings 'experimental::args_array_with_signatures'; ## no critic (ProhibitNoWarnings)
7  
8 use Carp;
9  
10 sub new( $class, @args ) {
11 croak "invalid arguments" if @args % 2;
12 my %args = @args;
13 my $self = bless {}, $class;
14 foreach my $key ( keys %args ) {
15 $self->$key( $args{$key} );
16 }
17 return $self;
18 }
19  
20 sub type( $self, $val = undef ) {
21 return $self->{type} if @_ == 1;
22 croak "invalid type"
23 if !defined $val
24 || 0 == grep {/^$val$/ix}
25 qw/ forwarded sampled_out trusted_forwarder
26 mailing_list local_policy other /;
27 return $self->{type} = $val;
28 }
29  
30 sub comment( $self, $val = undef ) {
31 return $self->{comment} if @_ == 1;
32  
33 # comment is optional and requires no validation
34 return $self->{comment} = $val;
35 }
36  
37 1;
38  
39 __END__
40  
41 =pod
42  
43 =head1 NAME
44  
45 Mail::DMARC::Result::Reason - policy override reason
46  
47 =head1 VERSION
48  
49 version 2.20260827
50  
51 =head1 METHODS
52  
53 =head2 type
54  
55 Type is the type of override used, and is one of a number of fixed strings.
56  
57 =head2 comment
58  
59 Comment may or may not be present, and may be anything.
60  
61 =head1 AUTHORS
62  
63 =over 4
64  
65 =item *
66  
67 Matt Simerson <msimerson@cpan.org>
68  
69 =item *
70  
71 Davide Migliavacca <shari@cpan.org>
72  
73 =item *
74  
75 Marc Bradshaw <marc@marcbradshaw.net>
76  
77 =back
78  
79 =head1 COPYRIGHT AND LICENSE
80  
81 This software is copyright (c) 2026 by Matt Simerson.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut