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 / ParameterValue.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Exception/Configuration/Option/Policy/ParameterValue.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::ParameterValue;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13
14 use Readonly;
15
16 use Perl::Critic::Utils qw{ :characters };
17
18 our $VERSION = '1.088';
19
20 #-----------------------------------------------------------------------------
21
22 use Exception::Class (
23     'Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue' => {
24         isa         => 'Perl::Critic::Exception::Configuration::Option::Policy',
25         description => 'A problem with the value of a parameter for a policy.',
26         alias       => 'throw_policy_value',
27     },
28 );
29
30 #-----------------------------------------------------------------------------
31
32 Readonly::Array our @EXPORT_OK => qw< throw_policy_value >;
33
34 #-----------------------------------------------------------------------------
35
36 sub full_message {
37     my ( $self ) = @_;
38
39     my $source = $self->source();
40     if ($source) {
41         $source = qq{ found in "$source"};
42     }
43     else {
44         $source = $EMPTY;
45     }
46
47     my $policy = $self->policy();
48     my $option_name = $self->option_name();
49     my $option_value =
50         defined $self->option_value()
51             ? $DQUOTE . $self->option_value() . $DQUOTE
52             : '<undef>';
53     my $message_suffix = $self->message_suffix() || $EMPTY;
54
55     return
56             qq{The value for the $policy "$option_name" option }
57         .   qq{($option_value)$source $message_suffix};
58 }
59
60
61 1;
62
63 __END__
64
65 #-----------------------------------------------------------------------------
66
67 =pod
68
69 =for stopwords
70
71 =head1 NAME
72
73 Perl::Critic::Exception::Configuration::Option::Policy::ParameterValue - A problem with the value of a parameter for a policy.
74
75 =head1 DESCRIPTION
76
77 A representation of a problem found with the value of a parameter for a
78 L<Perl::Critic::Policy>, whether from a F<.perlcriticrc>, another
79 profile file, or command line.
80
81
82 =head1 CLASS METHODS
83
84 =over
85
86 =item C<< throw( policy => $policy, option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >>
87
88 See L<Exception::Class/"throw">.
89
90
91 =item C<< new( policy => $policy, option_name => $option_name, option_value => $option_value, source => $source, message_suffix => $message_suffix ) >>
92
93 See L<Exception::Class/"new">.
94
95
96 =back
97
98
99 =head1 METHODS
100
101 =over
102
103 =item C<full_message()>
104
105 Provide a standard message for policy parameter value problems.  See
106 L<Exception::Class/"full_message">.
107
108
109 =back
110
111
112 =head1 AUTHOR
113
114 Elliot Shank <perl@galumph.com>
115
116 =head1 COPYRIGHT
117
118 Copyright (c) 2007-2008 Elliot Shank.  All rights reserved.
119
120 This program is free software; you can redistribute it and/or modify
121 it under the same terms as Perl itself.  The full text of this license
122 can be found in the LICENSE file included with this module.
123
124 =cut
125
126 # Local Variables:
127 #   mode: cperl
128 #   cperl-indent-level: 4
129 #   fill-column: 78
130 #   indent-tabs-mode: nil
131 #   c-indentation-style: bsd
132 # End:
133 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :