« blib/lib/Perl/Critic/Exception/Configuration/Option/Policy/ExtraParameter.pm
↑ Summary
blib/lib/Perl/Critic/PolicyParameter/Behavior/String.pm »
| 1 | package Perl::Critic::Exception::Configuration::Option::Policy; | ||||||||||
| 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 Perl::Critic::Utils qw( policy_short_name ); | ||||||||
|
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' => { | |||||||||
| 15 | isa => 'Perl::Critic::Exception::Configuration::Option', | ||||||||||
| 16 | description => 'A problem with the configuration of a policy.', | ||||||||||
| 17 | fields => [ qw{ policy } ], | ||||||||||
| 18 | }, | ||||||||||
| 19 | 40 | ▶ | ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | #----------------------------------------------------------------------------- | ||||||||||
| 22 | |||||||||||
| 23 | sub new { | ||||||||||
| 24 | 155 | ▶ | my ($class, %options) = @_; | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 25 | |||||||||||
| 26 | 155 | my $policy = $options{policy}; | |||||||||
| 27 | 155 | ▶ | if ($policy) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 153 | $options{policy} = policy_short_name($policy); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 155 | return $class->SUPER::new(%options); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | 40 | 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-2023 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 : | ||||||||||