Add ARM files
[dh-make-perl] / dev / arm / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / Policy / ClassHierarchies / ProhibitExplicitISA.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Policy/ClassHierarchies/ProhibitExplicitISA.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::Policy::ClassHierarchies::ProhibitExplicitISA;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13 use Readonly;
14
15 use Perl::Critic::Utils qw{ :severities };
16 use base 'Perl::Critic::Policy';
17
18 our $VERSION = '1.088';
19
20 #-----------------------------------------------------------------------------
21
22 Readonly::Scalar my $DESC => q{@ISA used instead of "use base"}; ##no critic; #for @ in string
23 Readonly::Scalar my $EXPL => [ 360 ];
24
25 #-----------------------------------------------------------------------------
26
27 sub supported_parameters { return ()                         }
28 sub default_severity     { return $SEVERITY_MEDIUM           }
29 sub default_themes       { return qw( core maintenance pbp ) }
30 sub applies_to           { return 'PPI::Token::Symbol'       }
31
32 #-----------------------------------------------------------------------------
33
34 sub violates {
35     my ($self, $elem, undef) = @_;
36
37     if( $elem eq q{@ISA} ) {  ##no critic; #for @ in string
38         return $self->violation( $DESC, $EXPL, $elem );
39     }
40     return; #ok!
41 }
42
43 1;
44
45 #-----------------------------------------------------------------------------
46
47 __END__
48
49 =pod
50
51 =head1 NAME
52
53 Perl::Critic::Policy::ClassHierarchies::ProhibitExplicitISA - Employ C<use base> instead of C<@ISA>.
54
55 =head1 AFFILIATION
56
57 This Policy is part of the core L<Perl::Critic> distribution.
58
59
60 =head1 DESCRIPTION
61
62 Conway recommends employing C<use base qw(Foo)> instead of the usual
63 C<our @ISA = qw(Foo)> because the former happens at compile time and
64 the latter at runtime.  The C<base> pragma also automatically loads
65 C<Foo> for you so you save a line of easily-forgotten code.
66
67
68 =head1 CONFIGURATION
69
70 This Policy is not configurable except for the standard options.
71
72
73 =head1 AUTHOR
74
75 Chris Dolan <cdolan@cpan.org>
76
77 =head1 COPYRIGHT
78
79 Copyright (C) 2006 Chris Dolan.  All rights reserved.
80
81 This program is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.
83
84 =cut
85
86 # Local Variables:
87 #   mode: cperl
88 #   cperl-indent-level: 4
89 #   fill-column: 78
90 #   indent-tabs-mode: nil
91 #   c-indentation-style: bsd
92 # End:
93 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :