PDF/Null.pm

filter: Statementstmt 58.8% 10 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 2 / 8 Podpod 100% 6 / 6 totaltotal 58.0% 18 / 31 CC 1 SCAR 5.6
CC
1
Cov
59%
new
2.0
realise
2.0
outobjdeep
2.0
CRAP 1.8
« PDF/Bool.pm ↑ Summary PDF.pm »
1 package Text::PDF::Null;
2  
3 =head1 NAME
4  
5 Text::PDF::Null - PDF Null type object. This is a subclass of
6 Text::PDF::Objind and cannot be subclassed.
7  
8 =head1 METHODS
9  
10 =cut
11
12 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 @ISA = qw(Text::PDF::Objind);
16  
17 # There is only one null object (section 3.2.8).
18 1 my ($null_obj) = {};
19 1 bless $null_obj, "Text::PDF::Null";
20  
21  
22 =head2 Text::PDF::Null->new
23  
24 Returns the null object. There is only one null object.
25  
26 =cut
27
28 sub new {
29 0 ▶ return $null_obj;
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
30 }
31  
32 =head2 $s->realise
33  
34 Pretends to finish reading the object.
35  
36 =cut
37  
38 sub realise {
39 0 ▶ return $null_obj;
Subroutine realise: not called CC=1 SCAR=6.9
Pod documented
40 }
41  
42 =head2 $s->outobjdeep
43  
44 Output the object in PDF format.
45  
46 =cut
47  
48 sub outobjdeep
49 {
50 0 ▶ my ($self, $fh, $pdf) = @_;
Subroutine outobjdeep: not called CC=1 SCAR=6.9
Pod documented
51 0 $fh->print ("null");
52 }
53  
54 =head2 $s->is_obj
55  
56 Returns false because null is not a full object.
57  
58 =cut
59  
60 sub is_obj {
61 0 ▶ return 0;
Subroutine is_obj: not called CC=1 SCAR=6.9
Pod documented
62 }
63  
64 =head2 $s->copy
65  
66 Another no-op.
67  
68 =cut
69
70 sub copy {
71 0 ▶ return $null_obj;
Subroutine copy: not called CC=1 SCAR=6.9
Pod documented
72 }
73  
74 =head2 $s->val
75  
76 Return undef.
77  
78 =cut
79
80 sub val
81 {
82 0 ▶ return undef;
Subroutine val: not called CC=1 SCAR=6.9
Pod documented
83 }
84  
85 1 1;
« PDF/Bool.pm ↑ Summary PDF.pm »