lib/TUI/toolkit/UO/Antlers.pm

filter: Statementstmt 88.6% 156 / 176 Branchbran 57.6% 45 / 78 Conditioncond 39.2% 20 / 51 MC/DCmcdc 0.0% 0 / 31 Subroutinesub 83.3% 25 / 30 Podpod 33.3% 2 / 6 totaltotal 66.6% 248 / 372 CC 63 SCAR 23.9
CC
63
Cov
72%
has
22.9
add_accessor
20.8
extends
13.3
CRAP 11.0
« lib/TUI/ColorSel/ColorDialog.pm ↑ Summary lib/TUI/ColorSel/ColorGroupList.pm »
1 package TUI::toolkit::UO::Antlers;
2 # ABSTRACT: Moose-like sugar for the UNIVERSAL::Object based class
3
4 115 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 115 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 115 our $VERSION = '0.08';
8 115 our $AUTHORITY = 'cpan:BRICKPOOL';
9
10 115 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11 115 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 115 ▶use UNIVERSAL::Object ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13
14 115 ▶BEGIN { $] >= 5.010 ? require mro : require MRO::Compat }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$] >= 5.01 ? : 115 0 115
15 115 ▶BEGIN {
Subroutine BEGIN: called CC=4 SCAR=15.5
16 *CAN_HAZ_XS = ( !exists $ENV{PERL_ONLY} && !$ENV{PERL_ONLY} &&
17 115 ▶ do { eval q[ use Class::XSAccessor ]; !$@ } )
Subroutine BEGIN: called CC=1 SCAR=0.0
18 ? sub() { !!1 }
19 : sub() { !!0 }
20 115 ▶}
Branch: 1 branch
BranchTrueFalseTotal
!(exists $ENV{'PERL_ONLY'} || $ENV{'PERL_ONLY'}) && do { eval ' use Class::XSAccessor '; not $@ } ? : 115 0 115
Condition33%2/6
not exists $ENV{"PERL_ONLY"} || $ENV{"PERL_ONLY"} and do { eval " use Class::XSAccessor "; not $@ }
!ll&&!rl&&r
00115
exists $ENV{'PERL_ONLY'} || $ENV{'PERL_ONLY'}
l!l&&r!l&&!r
00115
MC/DC0%0/3
not exists $ENV{"PERL_ONLY"} || $ENV{"PERL_ONLY"} and do { eval " use Class::XSAccessor "; not $@ }
exists $ENV{'PERL_ONLY'} $ENV{'PERL_ONLY'} do { eval " use Class::XSAccessor "; not $@ }
Truth table25%1/4
not(A || B) and C
A= exists $ENV{'PERL_ONLY'}B= $ENV{'PERL_ONLY'}C= do { eval " use Class::XSAccessor "; not $@ }
ABCresult
1XX0
01X0
0000
0011
21
22 # ----------------------------------------------------------------------
23 # Export keywords
24 # ----------------------------------------------------------------------
25
26 115 ▶use Importer ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27
28 115 our @EXPORT = qw(
29 has
30 extends
31 blessed
32 confess
33 );
34
35 # ----------------------------------------------------------------------
36 # import/unimport for setting up the class and exporting the symbols
37 # ----------------------------------------------------------------------
38
39 1493 ▶sub import {
Subroutine import: called CC=4 SCAR=13.9
40 1493 my ( $class, @imports ) = @_;
41 1493 my $caller = caller(0);
42
43 # Prevent double init per compilation unit
44 1493 ▶ return if $^H{ __PACKAGE__ . "/$caller" };
Branch: 1 branch
BranchTrueFalseTotal
if $^H{'TUI::toolkit::UO::Antlers' . "/$caller"} 0 1493 1493
45 1493 $^H{ __PACKAGE__ . "/$caller" } = 1;
46
47 # Turn on strict/warnings for caller
48 1493 strict->import;
49 1493 warnings->import;
50
51 # When exporting 'extends', we assume that a class hierarchy exists and
52 # inject the base class if the class in the hierarchy has no parent
53 1493 my $exports = Importer->get( $class, @imports );
54 1493 ▶ if ( $exports->{extends} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($exports->{"extends"}) 1493 0 1493
55 1493 require TUI::toolkit::UO::Base;
56 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
57 1492 unshift( @{"${caller}::ISA"}, 'TUI::toolkit::UO::Base' )
58 1493 ▶ unless ( @{"${caller}::ISA"} );
Branch: 1 branch
BranchTrueFalseTotal
unless @{"${caller}::ISA";} 1492 1 1493
59 }
60
61 1493 Importer->import_into( $class, $caller, @imports );
62 } #/ sub import
63
64 0 ▶sub unimport {
Subroutine unimport: not called CC=2 SCAR=17.9
65 0 my ( $class, @imports ) = @_;
66 0 my $caller = caller();
67
68 # TODO: 'unimport' only takes effect one time,
69 # but at least it's consistent with 'import'
70 0 ▶ return unless $^H{ __PACKAGE__ . "/$caller" };
Branch: 1 branch
BranchTrueFalseTotal
unless $^H{'TUI::toolkit::UO::Antlers' . "/$caller"} 0 0 0
71 0 $^H{ __PACKAGE__ . "/$caller" } = 0;
72
73 0 my $exports = Importer->get( $class, @imports );
74 0 Importer->unimport_from( $caller, keys %$exports );
75 }
76
77 # ----------------------------------------------------------------------
78 # Public API functions for class setup and field management
79 # ----------------------------------------------------------------------
80
81 4503 ▶sub has {
Subroutine has: called CC=14 SCAR=31.3
Pod documented
82 4503 my $class = caller( 0 );
83 4503 ▶ Carp::croak( "has() requires at least one attribute name" )
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 4503 4503
84 unless @_;
85
86 # Case 1: has 'x'
87 4503 ▶ if ( @_ == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1) 0 4503 4503
88 0 my ( $name ) = @_;
89 0 ▶ Carp::croak( "Attribute name must be a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name and not ref $name 0 0 0
Condition0%0/3
defined $name and not ref $name
!ll&&!rl&&r
000
MC/DC0%0/2
defined $name and not ref $name
defined $name not ref $name
Truth table0%0/3
A and not(B)
A= defined $nameB= not ref $name
ABresult
0X0
100
111
90 unless defined $name && !ref $name;
91
92 0 add_fields( $class, $name => undef );
93 0 add_accessor( $class, $name => 'rw' );
94 0 return;
95 }
96
97 # Case 2: has x => ( key => value, ... )
98 4503 my ( $name, @rest ) = @_;
99
100 4503 ▶ Carp::croak( "has($name) options must be key/value pairs" )
Branch: 1 branch
BranchTrueFalseTotal
unless @rest % 2 == 0 0 4503 4503
101 unless @rest % 2 == 0;
102
103 4503 my %opts = @rest;
104
105 # Check for unknown options and missing values.
106 4503 my %allowed = map { $_ => 1 } qw(is default);
107 4503 for my $key ( keys %opts ) {
108 Carp::croak("Unknown option '$key' for has($name)")
109 7672 ▶ unless $allowed{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless $allowed{$key} 0 7672 7672
110 }
111
112 4503 my $access = delete $opts{is};
113 Carp::croak( "Option 'is' must be 'ro', 'rw' or 'bare' for has($name)" )
114 4503 ▶ if defined $access && !grep { $_ eq $access } qw( ro rw bare );
Branch: 1 branch
BranchTrueFalseTotal
if defined $access and not grep({$_ eq $access;} "ro", "rw", "bare") 0 4503 4503
Condition66%2/3
defined $access and not grep({$_ eq $access;} "ro", "rw", "bare")
!ll&&!rl&&r
145020
MC/DC0%0/2
defined $access and not grep({$_ eq $access;} "ro", "rw", "bare")
defined $access not grep({$_ eq $access;} "ro", "rw", "bare")
Truth table66%2/3
A and not(B)
A= defined $accessB= not grep({$_ eq $access;} "ro", "rw", "bare")
ABresult
0X0
100
111
115
116 # Prepare default value
117 4503 my $default;
118 4503 ▶ if ( exists $opts{default} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $opts{"default"}) 3170 1333 4503
119 3170 $default = do {
120 3170 my $d = delete $opts{default};
121 3170 my $r = ref $d;
122 0 ▶ $r eq 'HASH' ? sub { +{%$d} } :
Subroutine __ANON__: not called CC=1 SCAR=6.9
123 0 ▶ $r eq 'ARRAY' ? sub { [@$d] } :
Subroutine __ANON__: not called CC=1 SCAR=6.9
124 $r eq 'CODE' ? $d :
125 3170 ▶ sub { $d } ;
Subroutine __ANON__: called CC=1 SCAR=0.2
Branch: 3 branches
BranchTrueFalseTotal
$r eq 'HASH' ? : 0 3170 3170
$r eq 'ARRAY' ? : 0 3170 3170
$r eq 'CODE' ? : 1280 1890 3170
126 };
127 }
128
129 4503 add_fields( $class, $name => $default );
130 4503 add_accessor( $class, $name => $access );
131
132 4503 return;
133 } #/ sub has
134
135 # The C<extends> function adds the given parent classes to the caller's C<@ISA>.
136 # For example:
137 # package Foo;
138 # use TUI::toolkit::UO::Antlers;
139 # extends 'Bar', 'Baz';
140 1081 ▶sub extends { # void (@parents)
Subroutine extends: called CC=11 SCAR=25.8
Pod documented
141 1081 my ( @parents ) = @_;
142 1081 my $class = caller(0);
143 1081 ▶ Carp::croak( "No parent classes provided to extends" ) unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 1081 1081
144
145 # like the parent pragma we check if the parents are already loaded and load
146 # them if not. This is required to ensure that the fields are inherited
147 # correctly.
148 1081 foreach my $parent ( @parents ) {
149 # sanity check for parent class names
150 1198 ▶ Carp::croak( "Parent class names must be plain strings" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $parent and not ref $parent 0 1198 1198
Condition33%1/3
defined $parent and not ref $parent
!ll&&!rl&&r
001198
MC/DC0%0/2
defined $parent and not ref $parent
defined $parent not ref $parent
Truth table33%1/3
A and not(B)
A= defined $parentB= not ref $parent
ABresult
0X0
100
111
151 unless defined $parent and !ref $parent;
152
153 1198 ( my $file = "$parent.pm" ) =~ s{::}{/}g;
154 1198 ▶ eval { require $file; 1 }
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require $file; 1 } } or Carp::croak("Failed to load parent class ${parent}: $@") 1198 0 1198
155 or Carp::croak("Failed to load parent class $parent: $@");
156 }
157
158 1081 my $isa = do {
159 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
160 1081 \@{"${class}::ISA"};
161 };
162
163 # Base is always injected by import() as the first entry in @ISA.
164 # extends() may remove this early injection if a parent already provides Base.
165 1081 ▶ if ( grep { $_->isa( 'TUI::toolkit::UO::Base' ) } @parents ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$_->isa("TUI::toolkit::UO::Base");} @parents) 1081 0 1081
166 1081 ▶ shift( @$isa ) if @$isa && $isa->[0] eq 'TUI::toolkit::UO::Base';
Branch: 1 branch
BranchTrueFalseTotal
if @$isa and $isa->[0] eq "TUI::toolkit::UO::Base" 1081 0 1081
Condition33%1/3
@$isa and $isa->[0] eq "TUI::toolkit::UO::Base"
!ll&&!rl&&r
001081
MC/DC0%0/2
@$isa and $isa->[0] eq "TUI::toolkit::UO::Base"
@$isa $isa->[0] eq "TUI::toolkit::UO::Base"
Truth table33%1/3
A and B
A= @$isaB= $isa->[0] eq "TUI::toolkit::UO::Base"
ABresult
0X0
100
111
167 }
168
169 # get reference to %HAS (create new %HAS if necessary)
170 1081 my $has = get_fields( $class );
171
172 # %a: %HAS from this $class (without parents)
173 1081 my %b = ();
174 0 %b = ( %b, %{ get_fields( $_ ) } )
175 0 for grep { has_fields( $_ ) } reverse @$isa;
176 0 my %a = map { $_ => $has->{$_} }
177 0 grep { !exists $b{$_} } keys %$has;
178
179 # Add the new parents to @ISA.
180 1081 push @$isa, @parents;
181
182 # %b: %HAS from all superclasses (including new parents)
183 1081 %b = ();
184 1058 %b = ( %b, %{ get_fields( $_ ) } )
185 1081 for grep { has_fields( $_ ) } reverse @$isa;
186
187 # We have new parent classes, so %HAS must be regenerated
188 1081 %$has = ( %b, %a );
189
190 1081 return;
191 } #/ sub extends
192
193 # Alias for re-export 'blessed' and 'confess' like Moo/se does.
194 115 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
195 115 *blessed = \&Scalar::Util::blessed;
196 115 *confess = \&Carp::confess;
197 }
198
199 # ----------------------------------------------------------------------
200 # Utility functions for class setup and field management
201 # ----------------------------------------------------------------------
202
203 # A simple check to see if the given C<$class> has a C<%HAS> hash defined. A
204 # simple test like C<defined %{"${class}::HAS"}> will sometimes produce typo
205 # warnings because it would create the hash if it was not present before.
206 5996 ▶sub has_fields { # $bool ($class)
Subroutine has_fields: called CC=4 SCAR=14.6
Pod undocumented
207 5996 my ( $proto ) = @_;
208 5996 ▶ my $class = ref $proto || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
059960
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
209 5996 ▶ Carp::croak( "[ARGS] class must be an object or a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $class and not ref $class 0 5996 5996
Condition33%1/3
defined $class and not ref $class
!ll&&!rl&&r
005996
MC/DC0%0/2
defined $class and not ref $class
defined $class not ref $class
Truth table33%1/3
A and not(B)
A= defined $classB= not ref $class
ABresult
0X0
100
111
210 unless defined $class and !ref $class;
211
212 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
213 115 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
214 5996 return defined *{"${class}::HAS"}{HASH};
215 }
216
217 # Gets a reference to the C<%HAS> hash for the given C<$class>. It will
218 # autogenerate a C<%HAS> hash if one doesn't already exist. If you don't want
219 # this behavior, be sure to check beforehand with L</has_fields>.
220 6939 ▶sub get_fields { # \%HAS ($class)
Subroutine get_fields: called CC=5 SCAR=16.7
Pod undocumented
221 6939 my ( $proto ) = @_;
222 6939 ▶ my $class = ref $proto || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
069390
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
223 6939 ▶ Carp::croak( "[ARGS] class must be an object or a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $class and not ref $class 0 6939 6939
Condition33%1/3
defined $class and not ref $class
!ll&&!rl&&r
006939
MC/DC0%0/2
defined $class and not ref $class
defined $class not ref $class
Truth table33%1/3
A and not(B)
A= defined $classB= not ref $class
ABresult
0X0
100
111
224 unless defined $class and !ref $class;
225
226 # avoid possible typo warnings
227 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
228 6939 ▶ %{"${class}::HAS"} = () unless %{"${class}::HAS"};
Branch: 1 branch
BranchTrueFalseTotal
unless %{"${class}::HAS";} 1811 5128 6939
229 6939 return \%{"${class}::HAS"};
230 }
231
232 # Adds a bunch of C<%slots> to the given C<$class>. For example:
233 # # Add the public slots 'this' and 'that' to the class Foo
234 # require TUI::toolkit::UO::Antlers;
235 # TUI::toolkit::UO::Antlers::add_fields( 'Foo',
236 # this => sub { 'foo' },
237 # that => sub { 'bar' },
238 # );
239 4503 ▶sub add_fields { # void ($class, %slots)
Subroutine add_fields: called CC=10 SCAR=24.0
Pod undocumented
240 4503 my ( $proto, @slots ) = @_;
241 4503 ▶ my $class = ref $proto || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
045030
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
242 4503 ▶ Carp::croak( "[ARGS] class must be an object or a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $class and not ref $class 0 4503 4503
Condition33%1/3
defined $class and not ref $class
!ll&&!rl&&r
004503
MC/DC0%0/2
defined $class and not ref $class
defined $class not ref $class
Truth table33%1/3
A and not(B)
A= defined $classB= not ref $class
ABresult
0X0
100
111
243 unless defined $class and !ref $class;
244 4503 ▶ Carp::croak( "[ARGS] slots must be provided as key/value pairs" )
Branch: 1 branch
BranchTrueFalseTotal
unless @slots % 2 == 0 0 4503 4503
245 unless @slots % 2 == 0;
246
247 # Quick bail out if nothing is to be added.
248 4503 ▶ return unless @slots;
Branch: 1 branch
BranchTrueFalseTotal
unless @slots 0 4503 4503
249
250 # if %HAS does not exist, it is a base class for which %HAS must be created.
251 4503 ▶ unless ( has_fields( $class ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (has_fields($class)) 295 4208 4503
252 # Create empty %HAS and get the reference
253 295 my $has = get_fields( $class );
254
255 295 my $isa = do {
256 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
257 295 \@{"${class}::ISA"};
258 };
259
260 # copy all superclass entries to %HAS
261 0 %$has = ( %$has, %{ get_fields( $class ) } )
262 295 for grep { has_fields( $_ ) } reverse @$isa;
263 }
264
265 4503 my %slots = @slots;
266 4503 my $has = get_fields( $class );
267 4503 foreach ( keys %slots ) {
268 4503 ▶ $has->{$_} = ref $slots{$_} eq 'CODE' ? $slots{$_} : eval 'sub { }';
Branch: 1 branch
BranchTrueFalseTotal
ref $slots{$_} eq 'CODE' ? : 3170 1333 4503
269 }
270
271 4503 return;
272 } #/ sub add_fields
273
274 # If you want to create a new accessor, use L</add_accessor>. It ensures that
275 # a read/write accessor sub is created (if not already present;
276 # C<unless __PACKAGE__->can($field)>). C<$access> is an optional parameter that
277 # supports the values C<'ro'>, C<'rw'> and C<'bare'>. If not specified, the
278 # C<'rw'> access is used.
279 4503 ▶sub add_accessor { # void ($class, $field, |$access)
Subroutine add_accessor: called CC=14 SCAR=30.4
Pod undocumented
280 4503 my ( $class, $field, $access ) = @_;
281 4503 ▶ $class = ref $class if blessed $class;
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($class) 0 4503 4503
282 4503 ▶ $access = 'rw' unless defined $access;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $access 1 4502 4503
283 4503 ▶ Carp::croak( "[ARGS] class must be an object or a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $class and not ref $class 0 4503 4503
Condition33%1/3
defined $class and not ref $class
!ll&&!rl&&r
004503
MC/DC0%0/2
defined $class and not ref $class
defined $class not ref $class
Truth table33%1/3
A and not(B)
A= defined $classB= not ref $class
ABresult
0X0
100
111
284 unless defined $class and !ref $class;
285 4503 ▶ Carp::croak( "[ARGS] field must be a plain string" )
Branch: 1 branch
BranchTrueFalseTotal
unless defined $field and not ref $field 0 4503 4503
Condition33%1/3
defined $field and not ref $field
!ll&&!rl&&r
004503
MC/DC0%0/2
defined $field and not ref $field
defined $field not ref $field
Truth table33%1/3
A and not(B)
A= defined $fieldB= not ref $field
ABresult
0X0
100
111
286 unless defined $field and !ref $field;
287 4503 ▶ Carp::croak( "[ARGS] access must be 'ro', 'rw' or 'bare'" )
Branch: 1 branch
BranchTrueFalseTotal
if not defined $access or $access ne "ro" and $access ne "rw" and $access ne "bare" 0 4503 4503
Condition66%6/9
not defined $access or $access ne "ro" and $access ne "rw" and $access ne "bare"
l!l&&r!l&&!r
004503
$access ne "ro" and $access ne "rw" and $access ne "bare"
!ll&&!rl&&r
36108930
$access ne "ro" and $access ne "rw"
!ll&&!rl&&r
11172493893
MC/DC0%0/4
not defined $access or $access ne "ro" and $access ne "rw" and $access ne "bare"
not defined $access $access ne "ro" $access ne "rw" $access ne "bare"
Truth table60%3/5
not(A) or B and C and D
A= not defined $accessB= $access ne "ro"C= $access ne "rw"D= $access ne "bare"
ABCDresult
1XXX1
01111
00XX0
010X0
01100
288 if !defined $access
289 || ( $access ne 'ro' && $access ne 'rw' && $access ne 'bare' );
290
291 # Only create accessors unless is 'bare'
292 4503 ▶ return if $access eq 'bare';
Branch: 1 branch
BranchTrueFalseTotal
if $access eq "bare" 893 3610 4503
293
294 # Only create accessors unless exists
295 3610 ▶ return if $class->can( $field );
Branch: 1 branch
BranchTrueFalseTotal
if $class->can($field) 4 3606 3610
296
297 # create the accessor and use the XS version if available
298 3606 if ( CAN_HAZ_XS ) {
299 3606 ▶ my $mutator = $access eq 'ro' ? 'getters' : 'accessors';
Branch: 1 branch
BranchTrueFalseTotal
$access eq 'ro' ? : 1113 2493 3606
300 3606 Class::XSAccessor->import(
301 class => $class,
302 $mutator => { $field => $field },
303 );
304 }
305 else {
306 my $acc = "${class}::${field}";
307 unless ( exists &$acc ) {
308 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
309 *$acc = $access eq 'ro'
310 0 ▶ ? sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
311 $#_
312 ? Carp::croak( "Usage: ${class}::${field}(self)" )
313 0 ▶ : $_[0]->{$field};
Branch: 1 branch
BranchTrueFalseTotal
$#_ ? : 0 0 0
314 }
315 0 ▶ : sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
316 $#_
317 ? $_[0]->{$field} = $_[1]
318 0 ▶ : $_[0]->{$field};
Branch: 1 branch
BranchTrueFalseTotal
$#_ ? : 0 0 0
319 }
320 } #/ unless ( exists &$acc )
321 } #/ else [ if ( CAN_HAZ_XS ) ]
322
323 3606 return;
324 } #/ sub add_accessor
325
326 115 1;
327
328 __END__
« lib/TUI/ColorSel/ColorDialog.pm ↑ Summary lib/TUI/ColorSel/ColorGroupList.pm »