blib/lib/Perl/Critic/Exception/Configuration/Option/Policy/ExtraParameter.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 94.1% 32 / 34 CC 2 SCAR 2.6
CC
2
Cov
93%
full_message
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Perl/Critic/Exception/Configuration/Option/Global/ExtraParameter.pm ↑ Summary blib/lib/Perl/Critic/Exception/Configuration/Option/Policy.pm »
1 package Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter;
2  
3 40 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 40 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 our $VERSION = '1.150';
10  
11 #-----------------------------------------------------------------------------
12  
13 use Exception::Class (
14 40 'Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter' => {
15 isa => 'Perl::Critic::Exception::Configuration::Option::Policy',
16 description => 'The configuration of a policy referred to a non-existent parameter.',
17 alias => 'throw_extra_parameter',
18 },
19 40 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 #-----------------------------------------------------------------------------
22  
23 40 Readonly::Array our @EXPORT_OK => qw< throw_extra_parameter >;
24  
25 #-----------------------------------------------------------------------------
26  
27 sub full_message {
28 145 ▶ my ( $self ) = @_;
Subroutine full_message: called CC=2 SCAR=7.1
Pod documented
29  
30 145 my $source = $self->source();
31 145 ▶ if ($source) {
Branch: 1 branch
BranchTrueFalseTotal
if ($source) { } 0 145 145
32 0 $source = qq{ (found in "$source")};
33 }
34 else {
35 145 $source = q{};
36 }
37  
38 145 my $policy = $self->policy();
39 145 my $option_name = $self->option_name();
40  
41 return
42 145 qq{The $policy policy doesn't take a "$option_name" option$source.};
43 }
44  
45  
46 40 1;
47  
48 __END__
49  
50 #-----------------------------------------------------------------------------
51  
52 =pod
53  
54 =for stopwords
55  
56 =head1 NAME
57  
58 Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter - The configuration referred to a non-existent parameter for a policy.
59  
60 =head1 DESCRIPTION
61  
62 A representation of the configuration attempting to specify a value
63 for a parameter that a L<Perl::Critic::Policy|Perl::Critic::Policy>
64 doesn't have, whether from a F<.perlcriticrc>, another profile file,
65 or command line.
66  
67  
68 =head1 INTERFACE SUPPORT
69  
70 This is considered to be a public class. Any changes to its interface
71 will go through a deprecation cycle.
72  
73  
74 =head1 CLASS METHODS
75  
76 =over
77  
78 =item C<< throw( policy => $policy, option_name => $option_name, source => $source ) >>
79  
80 See L<Exception::Class/"throw">.
81  
82  
83 =item C<< new( policy => $policy, option_name => $option_name, source => $source ) >>
84  
85 See L<Exception::Class/"new">.
86  
87  
88 =back
89  
90  
91 =head1 METHODS
92  
93 =over
94  
95 =item C<full_message()>
96  
97 Provide a standard message for values for non-existent parameters for
98 policies. See L<Exception::Class/"full_message">.
99  
100  
101 =back
102  
103  
104 =head1 AUTHOR
105  
106 Elliot Shank <perl@galumph.com>
107  
108 =head1 COPYRIGHT
109  
110 Copyright (c) 2007-2011 Elliot Shank.
111  
112 This program is free software; you can redistribute it and/or modify
113 it under the same terms as Perl itself. The full text of this license
114 can be found in the LICENSE file included with this module.
115  
116 =cut
117  
118 # Local Variables:
119 # mode: cperl
120 # cperl-indent-level: 4
121 # fill-column: 78
122 # indent-tabs-mode: nil
123 # c-indentation-style: bsd
124 # End:
125 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :
« blib/lib/Perl/Critic/Exception/Configuration/Option/Global/ExtraParameter.pm ↑ Summary blib/lib/Perl/Critic/Exception/Configuration/Option/Policy.pm »