lib/WWW/Shopify/Liquid/Dialect/Web/Filter/LinkTo.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 28 CC 3 SCAR 17.5
CC
3
Cov
0%
operate
12.0
min_arguments
2.0
max_arguments
2.0
CRAP 5.8
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4  
5 package WWW::Shopify::Liquid::Dialect::Web::Filter::LinkTo; use base 'WWW::Shopify::Liquid::Filter';
6  
7 sub min_arguments { return 1; }
8 sub max_arguments { return 1; }
9  
10 sub operate {
11 my ($self, $hash, $operand, $link) = @_;
12 $operand = '' unless defined $operand;
13 $link = '' unless defined $link;
14 return "<a href='" . $link . "'>" . $operand . "</a>";
15 }
16  
17 1;