API2/Basic/PDF/Null.pm

filter: Statementstmt 75.0% 12 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 100% 6 / 6 totaltotal 73.3% 22 / 30 CC 1 SCAR 4.1
CC
1
Cov
75%
realise
2.0
is_obj
2.0
copy
2.0
CRAP 1.5
« API2/Basic/PDF/Bool.pm ↑ Summary API2/Resource/XObject.pm »
1 # Code in the PDF::API2::Basic::PDF namespace was originally copied from the
2 # Text::PDF distribution.
3 #
4 # Copyright Martin Hosken <Martin_Hosken@sil.org>
5 #
6 # Martin Hosken's code may be used under the terms of the MIT license.
7 # Subsequent versions of the code have the same license as PDF::API2.
8  
9 package PDF::API2::Basic::PDF::Null;
10  
11 41 ▶use base 'PDF::API2::Basic::PDF::Objind';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 41 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 41 our $VERSION = '2.049'; # VERSION
16  
17 =head1 NAME
18  
19 PDF::API2::Basic::PDF::Null - Low-level PDF null object
20  
21 =head1 METHODS
22  
23 =cut
24  
25 # There is only one null object (section 3.2.8).
26 41 my $null_obj = bless {}, 'PDF::API2::Basic::PDF::Null';
27  
28 =head2 PDF::API2::Basic::PDF::Null->new
29  
30 Returns the null object. There is only one null object.
31  
32 =cut
33  
34 12 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
35 12 return $null_obj;
36 }
37  
38 =head2 $s->realise
39  
40 Pretends to finish reading the object.
41  
42 =cut
43  
44 0 ▶sub realise {
Subroutine realise: not called CC=1 SCAR=6.9
Pod documented
45 0 return $null_obj;
46 }
47  
48 =head2 $s->outobjdeep
49  
50 Output the object in PDF format.
51  
52 =cut
53  
54 12 ▶sub outobjdeep {
Subroutine outobjdeep: called CC=1 SCAR=0.0
Pod documented
55 12 my ($self, $fh, $pdf) = @_;
56 12 $fh->print('null');
57 }
58  
59 =head2 $s->is_obj
60  
61 Returns false because null is not a full object.
62  
63 =cut
64  
65 0 ▶sub is_obj {
Subroutine is_obj: not called CC=1 SCAR=6.9
Pod documented
66 0 return 0;
67 }
68  
69 =head2 $s->copy
70  
71 Another no-op.
72  
73 =cut
74  
75 0 ▶sub copy {
Subroutine copy: not called CC=1 SCAR=6.9
Pod documented
76 0 return $null_obj;
77 }
78  
79 =head2 $s->val
80  
81 Return undef.
82  
83 =cut
84  
85 0 ▶sub val {
Subroutine val: not called CC=1 SCAR=6.9
Pod documented
86 0 return undef; ## no critic (undef is intentional)
87 }
88  
89 41 1;
« API2/Basic/PDF/Bool.pm ↑ Summary API2/Resource/XObject.pm »