File Coverage

blib/lib/Perl/Critic/Exception/Configuration/Option/Policy.pm
Criterion Covered Total %
statement 19 19 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Perl::Critic::Exception::Configuration::Option::Policy;
2              
3 40     40   27575 use 5.010001;
  40         401  
4 40     40   546 use strict;
  40         103  
  40         839  
5 40     40   250 use warnings;
  40         87  
  40         1248  
6              
7 40     40   281 use Perl::Critic::Utils qw{ &policy_short_name };
  40         102  
  40         5793  
8              
9             our $VERSION = '1.148';
10              
11             #-----------------------------------------------------------------------------
12              
13             use Exception::Class (
14 40         366 'Perl::Critic::Exception::Configuration::Option::Policy' => {
15             isa => 'Perl::Critic::Exception::Configuration::Option',
16             description => 'A problem with the configuration of a policy.',
17             fields => [ qw{ policy } ],
18             },
19 40     40   378 );
  40         91  
20              
21             #-----------------------------------------------------------------------------
22              
23             sub new {
24 157     157 1 24864 my ($class, %options) = @_;
25              
26 157         340 my $policy = $options{policy};
27 157 100       438 if ($policy) {
28 155         406 $options{policy} = policy_short_name($policy);
29             }
30              
31 157         717 return $class->SUPER::new(%options);
32             }
33              
34              
35             1;
36              
37             __END__
38              
39             #-----------------------------------------------------------------------------
40              
41             =pod
42              
43             =for stopwords
44              
45             =head1 NAME
46              
47             Perl::Critic::Exception::Configuration::Option::Policy - A problem with configuration of a policy.
48              
49             =head1 DESCRIPTION
50              
51             A representation of a problem found with the configuration of a
52             L<Perl::Critic::Policy|Perl::Critic::Policy>, whether from a
53             F<.perlcriticrc>, another profile file, or command line.
54              
55             This is an abstract class. It should never be instantiated.
56              
57              
58             =head1 INTERFACE SUPPORT
59              
60             This is considered to be a public class. Any changes to its interface
61             will go through a deprecation cycle.
62              
63              
64             =head1 METHODS
65              
66             =over
67              
68             =item C<policy()>
69              
70             The short name of the policy that had configuration problems.
71              
72              
73             =back
74              
75              
76             =head1 AUTHOR
77              
78             Elliot Shank <perl@galumph.com>
79              
80             =head1 COPYRIGHT
81              
82             Copyright (c) 2007-2011 Elliot Shank.
83              
84             This program is free software; you can redistribute it and/or modify
85             it under the same terms as Perl itself. The full text of this license
86             can be found in the LICENSE file included with this module.
87              
88             =cut
89              
90             # Local Variables:
91             # mode: cperl
92             # cperl-indent-level: 4
93             # fill-column: 78
94             # indent-tabs-mode: nil
95             # c-indentation-style: bsd
96             # End:
97             # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :