WE_Frontend/Plugin/NullFilter.pm

filter: Statementstmt 84.6% 11 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 77.7% 14 / 18 CC 1 SCAR 2.2
CC
1
Cov
85%
filter
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« WE_Frontend/Plugin/Breadcrumb.pm ↑ Summary WebEditor/OldFeatures/TimeBased.pm »
1 # -*- perl -*-
2  
3 #
4 # $Id: NullFilter.pm,v 1.1 2004/03/25 13:52:43 eserte Exp $
5 # Author: Slaven Rezic
6 #
7 # Copyright (C) 2004 Slaven Rezic.
8 # This is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License, see the file COPYING.
10  
11 #
12 # Mail: slaven@rezic.de
13 # WWW: http://we-framework.sourceforge.net
14 #
15  
16 package WE_Frontend::Plugin::NullFilter; # <-- change this
17 1 ▶use base qw(Template::Plugin::Filter);
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
22  
23 =head1 NAME
24  
25 WE_Frontend::Plugin::NullFilter - a sample custom filter
26  
27 =head1 SYNOPSIS
28  
29 # In the calling script (normally already done by WebEditor::OldController)
30 my $t = Template->new({PLUGIN_BASE => "WE_Frontend::Plugin"});
31  
32 # In the template
33 [% USE NullFilter %]
34 [% FILTER $NullFilter %]
35 ...
36 [% END %]
37 [% variable | $NullFilter %]
38  
39 =head1 DESCRIPTION
40  
41 This filter does nothing, i.e. it copies the input unchanged to the
42 output. This module serves as a sample filter for own extensions.
43  
44 =cut
45  
46 0 ▶sub filter {
Subroutine filter: not called CC=1 SCAR=6.9
Pod undocumented
47 0 my($self, $text) = @_;
48 # do something interesting with $text
49 0 return $text;
50 }
51  
52 1 1;
53  
54 __END__
« WE_Frontend/Plugin/Breadcrumb.pm ↑ Summary WebEditor/OldFeatures/TimeBased.pm »