Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / Exception / Configuration / Option / Policy / ExtraParameter.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Exception/Configuration/Option/Policy/ExtraParameter.pm $
3 #     $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
4 #   $Author: clonezone $
5 # $Revision: 2489 $
6 ##############################################################################
7
8 package Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13
14 use Readonly;
15
16 our $VERSION = '1.088';
17
18 #-----------------------------------------------------------------------------
19
20 use Exception::Class (
21     'Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter' => {
22         isa         => 'Perl::Critic::Exception::Configuration::Option::Policy',
23         description => 'The configuration of a policy referred to a non-existant parameter.',
24         alias       => 'throw_extra_parameter',
25     },
26 );
27
28 #-----------------------------------------------------------------------------
29
30 Readonly::Array our @EXPORT_OK => qw< throw_extra_parameter >;
31
32 #-----------------------------------------------------------------------------
33
34 sub full_message {
35     my ( $self ) = @_;
36
37     my $source = $self->source();
38     if ($source) {
39         $source = qq{ (found in "$source")};
40     }
41     else {
42         $source = q{};
43     }
44
45     my $policy = $self->policy();
46     my $option_name = $self->option_name();
47
48     return
49         qq{The $policy policy doesn't take a "$option_name" option$source.};
50 }
51
52
53 1;
54
55 __END__
56
57 #-----------------------------------------------------------------------------
58
59 =pod
60
61 =for stopwords
62
63 =head1 NAME
64
65 Perl::Critic::Exception::Configuration::Option::Policy::ExtraParameter - The configuration referred to a non-existent parameter for a policy.
66
67 =head1 DESCRIPTION
68
69 A representation of the configuration attempting to specify a value
70 for a parameter that a L<Perl::Critic::Policy> doesn't have, whether
71 from a F<.perlcriticrc>, another profile file, or command line.
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-2008 Elliot Shank.  All rights reserved.
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 :