line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Critic::PolicyParameter::Behavior::String; |
2
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
702
|
use 5.010001; |
|
40
|
|
|
|
|
165
|
|
4
|
40
|
|
|
40
|
|
243
|
use strict; |
|
40
|
|
|
|
|
97
|
|
|
40
|
|
|
|
|
812
|
|
5
|
40
|
|
|
40
|
|
1563
|
use warnings; |
|
40
|
|
|
|
|
108
|
|
|
40
|
|
|
|
|
1116
|
|
6
|
|
|
|
|
|
|
|
7
|
40
|
|
|
40
|
|
227
|
use Perl::Critic::Utils; |
|
40
|
|
|
|
|
200
|
|
|
40
|
|
|
|
|
642
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
34911
|
use parent qw{ Perl::Critic::PolicyParameter::Behavior }; |
|
40
|
|
|
|
|
102
|
|
|
40
|
|
|
|
|
254
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.148'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _parse { |
16
|
9914
|
|
|
9914
|
|
19389
|
my ($policy, $parameter, $config_string) = @_; |
17
|
|
|
|
|
|
|
|
18
|
9914
|
|
|
|
|
22039
|
my $value = $parameter->get_default_string(); |
19
|
|
|
|
|
|
|
|
20
|
9914
|
100
|
|
|
|
22861
|
if ( defined $config_string ) { |
21
|
1154
|
|
|
|
|
2369
|
$value = $config_string; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
9914
|
|
|
|
|
28852
|
$policy->__set_parameter_value($parameter, $value); |
25
|
|
|
|
|
|
|
|
26
|
9914
|
|
|
|
|
19443
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub initialize_parameter { |
32
|
11397
|
|
|
11397
|
1
|
23010
|
my ($self, $parameter, $specification) = @_; |
33
|
|
|
|
|
|
|
|
34
|
11397
|
|
|
|
|
35896
|
$parameter->_set_parser(\&_parse); |
35
|
|
|
|
|
|
|
|
36
|
11397
|
|
|
|
|
23307
|
return; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=pod |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=for stopwords |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Perl::Critic::PolicyParameter::Behavior::String - Actions appropriate for a simple string parameter. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 DESCRIPTION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Provides a standard set of functionality for a string |
59
|
|
|
|
|
|
|
L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter> so that |
60
|
|
|
|
|
|
|
the developer of a policy does not have to provide it her/himself. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
NOTE: Do not instantiate this class. Use the singleton instance held |
63
|
|
|
|
|
|
|
onto by |
64
|
|
|
|
|
|
|
L<Perl::Critic::PolicyParameter|Perl::Critic::PolicyParameter>. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is considered to be a non-public class. Its interface is subject |
70
|
|
|
|
|
|
|
to change without notice. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 METHODS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=over |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item C<initialize_parameter( $parameter, $specification )> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Plug in the functionality this behavior provides into the parameter. |
80
|
|
|
|
|
|
|
At present, this behavior isn't customizable by the specification. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 COPYRIGHT |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Copyright (c) 2007-2011 Elliot Shank. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
96
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
97
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Local Variables: |
102
|
|
|
|
|
|
|
# mode: cperl |
103
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
104
|
|
|
|
|
|
|
# fill-column: 78 |
105
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
106
|
|
|
|
|
|
|
# c-indentation-style: bsd |
107
|
|
|
|
|
|
|
# End: |
108
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |