line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Critic::PolicyParameter::Behavior; |
2
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
712
|
use 5.010001; |
|
40
|
|
|
|
|
159
|
|
4
|
40
|
|
|
40
|
|
241
|
use strict; |
|
40
|
|
|
|
|
100
|
|
|
40
|
|
|
|
|
859
|
|
5
|
40
|
|
|
40
|
|
212
|
use warnings; |
|
40
|
|
|
|
|
109
|
|
|
40
|
|
|
|
|
1459
|
|
6
|
|
|
|
|
|
|
|
7
|
40
|
|
|
40
|
|
262
|
use Perl::Critic::Utils qw{ :characters }; |
|
40
|
|
|
|
|
94
|
|
|
40
|
|
|
|
|
2327
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
200
|
|
|
200
|
0
|
390
|
my $class = shift; |
15
|
|
|
|
|
|
|
|
16
|
200
|
|
|
|
|
1277
|
return bless {}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub initialize_parameter { |
22
|
0
|
|
|
0
|
1
|
0
|
my ($self, $parameter, $specification) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
0
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub generate_parameter_description { |
30
|
401
|
|
|
401
|
1
|
892
|
my ($self, $parameter) = @_; |
31
|
|
|
|
|
|
|
|
32
|
401
|
|
|
|
|
1069
|
return $parameter->_get_description_with_trailing_period(); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=for stopwords |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Perl::Critic::PolicyParameter::Behavior - Default type-specific actions for a parameter. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Provides a standard set of functionality for a |
55
|
|
|
|
|
|
|
L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter> so that |
56
|
|
|
|
|
|
|
the developer of a policy does not have to provide it her/himself. |
57
|
|
|
|
|
|
|
The developer can override most of the functionality in the |
58
|
|
|
|
|
|
|
subclasses; these are just defaults. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
All subclasses have singleton instances held onto by |
61
|
|
|
|
|
|
|
L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter>. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This is considered to be a non-public class. Its interface is subject |
67
|
|
|
|
|
|
|
to change without notice. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 METHODS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=over |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=item C<initialize_parameter( $parameter, $specification )> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Plug in the functionality this behavior provides into the parameter, |
77
|
|
|
|
|
|
|
based upon the configuration provided by the specification. The |
78
|
|
|
|
|
|
|
configuration items looked for depends upon the specific behavior |
79
|
|
|
|
|
|
|
subclass. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item C<generate_parameter_description( $parameter )> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Create a description of the parameter, based upon the description on |
84
|
|
|
|
|
|
|
the parameter itself, but enhancing it with information from this |
85
|
|
|
|
|
|
|
behavior. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Note that this may return C<undef> if the parameter itself doesn't |
88
|
|
|
|
|
|
|
have a description. Also, the returned value may include multiple |
89
|
|
|
|
|
|
|
lines. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 COPYRIGHT |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Copyright (c) 2006-2011 Elliot Shank. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
103
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
104
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# Local Variables: |
109
|
|
|
|
|
|
|
# mode: cperl |
110
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
111
|
|
|
|
|
|
|
# fill-column: 78 |
112
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
113
|
|
|
|
|
|
|
# c-indentation-style: bsd |
114
|
|
|
|
|
|
|
# End: |
115
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |