Builder/Basic/PDF/Null.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 100% 6 / 6 totaltotal 77.7% 28 / 36 CC 1 SCAR 3.7
CC
1
Cov
81%
realise
2.0
is_obj
2.0
copy
2.0
CRAP 1.4
« Builder/Basic/PDF/Bool.pm ↑ Summary Builder/Resource/Font/CoreFont/bankgothic.pm »
1 #=======================================================================
2 #
3 # THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW:
4 #
5 # Copyright Martin Hosken <Martin_Hosken@sil.org>
6 #
7 # No warranty or expression of effectiveness, least of all regarding
8 # anyone's safety, is implied in this software or documentation.
9 #
10 # This specific module is licensed under the Perl Artistic License.
11 # Effective 28 January 2021, the original author and copyright holder,
12 # Martin Hosken, has given permission to use and redistribute this module
13 # under the MIT license.
14 #
15 #=======================================================================
16 package PDF::Builder::Basic::PDF::Null;
17  
18 42 ▶use base 'PDF::Builder::Basic::PDF::Objind';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 42 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 42 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 42 our $VERSION = '3.028'; # VERSION
24 42 our $LAST_UPDATE = '3.027'; # manually update whenever code is changed
25  
26 =head1 NAME
27  
28 PDF::Builder::Basic::PDF::Null - PDF Null type object
29  
30 This is a subclass of PDF::Builder::Basic::PDF::Objind and cannot be subclassed
31  
32 =head1 METHODS
33  
34 =cut
35  
36 # There is only one null object (section 3.2.8).
37 42 my $null_obj = bless {}, 'PDF::Builder::Basic::PDF::Null';
38  
39 =head2 new
40  
41 PDF::Builder::Basic::PDF::Null->new()
42  
43 =over
44  
45 Returns the null object. There is only one null object.
46  
47 =back
48  
49 =cut
50  
51 12 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
52 12 return $null_obj;
53 }
54  
55 =head2 realise
56  
57 $s->realise()
58  
59 =over
60  
61 Pretends to finish reading the object.
62  
63 =back
64  
65 =cut
66  
67 0 ▶sub realise {
Subroutine realise: not called CC=1 SCAR=6.9
Pod documented
68 0 return $null_obj;
69 }
70  
71 =head2 outobjdeep
72  
73 $s->outobjdeep()
74  
75 =over
76  
77 Output the object in PDF format.
78  
79 =back
80  
81 =cut
82  
83 12 ▶sub outobjdeep {
Subroutine outobjdeep: called CC=1 SCAR=0.0
Pod documented
84 12 my ($self, $fh, $pdf) = @_;
85  
86 12 $fh->print('null');
87 12 return;
88 }
89  
90 =head2 is_obj
91  
92 $s->is_obj()
93  
94 =over
95  
96 Returns false because null is not a full object.
97  
98 =back
99  
100 =cut
101  
102 0 ▶sub is_obj {
Subroutine is_obj: not called CC=1 SCAR=6.9
Pod documented
103 0 return 0;
104 }
105  
106 =head2 copy
107  
108 $s->copy()
109  
110 =over
111  
112 Another no-op.
113  
114 =back
115  
116 =cut
117  
118 0 ▶sub copy {
Subroutine copy: not called CC=1 SCAR=6.9
Pod documented
119 0 return $null_obj;
120 }
121  
122 =head2 val
123  
124 $s->val()
125  
126 =over
127  
128 Return undef.
129  
130 =back
131  
132 =cut
133  
134 0 ▶sub val {
Subroutine val: not called CC=1 SCAR=6.9
Pod documented
135 0 return undef; ## no critic (undef is intentional)
136 }
137  
138 42 1;
« Builder/Basic/PDF/Bool.pm ↑ Summary Builder/Resource/Font/CoreFont/bankgothic.pm »