Data/Message/Board/Comment.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Data/Message/Board.pm ↑ Summary Test/Shared/Fixture/Data/Message/Board/Example.pm »
1 package Data::Message::Board::Comment;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶use Mo qw(build default is);
Subroutine BEGIN: called CC=1 SCAR=2.6
7 use Mo::utils 0.28 qw(check_isa check_length check_required);
8 use Mo::utils::Number qw(check_positive_natural);
9  
10 our $VERSION = 0.06;
11  
12 has author => (
13 is => 'ro',
14 );
15  
16 has date => (
17 is => 'ro',
18 );
19  
20 has id => (
21 is => 'ro',
22 );
23  
24 has message => (
25 is => 'ro',
26 );
27  
28 sub BUILD {
29 my $self = shift;
30  
31 # Check author.
32 check_required($self, 'author');
33 check_isa($self, 'author', 'Data::Person');
34  
35 # Check date.
36 check_required($self, 'date');
37 check_isa($self, 'date', 'DateTime');
38  
39 # Check id.
40 check_positive_natural($self, 'id');
41  
42 # Check message.
43 check_required($self, 'message');
44 check_length($self, 'message', 4096);
45  
46 return;
47 }
48  
49 1;
50  
51 __END__
« Data/Message/Board.pm ↑ Summary Test/Shared/Fixture/Data/Message/Board/Example.pm »