File Coverage

blib/lib/PPI/Structure/For.pm
Criterion Covered Total %
statement 8 12 66.6
branch 1 4 25.0
condition 1 3 33.3
subroutine 3 3 100.0
pod 0 1 0.0
total 13 23 56.5


line stmt bran cond sub pod time code
1             package PPI::Structure::For;
2              
3             =pod
4              
5             =head1 NAME
6              
7             PPI::Structure::For - Circular braces for a for expression
8              
9             =head1 SYNOPSIS
10              
11             for ( var $i = 0; $i < $max; $i++ ) {
12             ...
13             }
14              
15             =head1 INHERITANCE
16              
17             PPI::Structure::For
18             isa PPI::Structure
19             isa PPI::Node
20             isa PPI::Element
21              
22             =head1 DESCRIPTION
23              
24             C is the class used for circular braces that
25             contain the three part C expression.
26              
27             =head1 METHODS
28              
29             C has no methods beyond those provided by the
30             standard L, L and L methods.
31              
32             =cut
33              
34 64     64   509 use strict;
  64         124  
  64         1989  
35 64     64   327 use PPI::Structure ();
  64         192  
  64         8076  
36              
37             our $VERSION = '1.277';
38              
39             our @ISA = "PPI::Structure";
40              
41             # Highly special custom isa method that will continue to respond
42             # positively to ->isa('PPI::Structure::ForLoop') but warns.
43             my $has_warned = 0;
44             sub isa {
45 2136 50 33 2136 0 6409 if ( $_[1] and $_[1] eq 'PPI::Structure::ForLoop' ) {
46 0 0       0 unless ( $has_warned ) {
47 0         0 warn("PPI::Structure::ForLoop has been deprecated");
48 0         0 $has_warned = 1;
49             }
50 0         0 return 1;
51             }
52 2136         10163 return shift->SUPER::isa(@_);
53             }
54              
55             1;
56              
57             =pod
58              
59             =head1 SUPPORT
60              
61             See the L in the main module.
62              
63             =head1 AUTHOR
64              
65             Adam Kennedy Eadamk@cpan.orgE
66              
67             =head1 COPYRIGHT
68              
69             Copyright 2001 - 2011 Adam Kennedy.
70              
71             This program is free software; you can redistribute
72             it and/or modify it under the same terms as Perl itself.
73              
74             The full text of the license can be found in the
75             LICENSE file included with this module.
76              
77             =cut