« blib/lib/WWW/Shopify/Liquid/Exception.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Operator/Regex.pm »
| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||
| 2 | 30 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 30 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package WWW::Shopify::Liquid::Filter::DateMath; | ||||||||||||||||||||||||||||
| 6 | 30 | ▶ | use base 'WWW::Shopify::Liquid::Filter'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | # +-, #, <unit> | ||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub min_arguments { return 2; } | ||||||||||||||||||||||||||
|
Subroutine
min_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub max_arguments { return 2; } | ||||||||||||||||||||||||||
|
Subroutine
max_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | sub operate { | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | my ($self, $hash, $operand, @arguments) = @_; | ||||||||||||||||||||||||||
|
Subroutine
operate: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 0 | my ($number, $unit) = @arguments; | |||||||||||||||||||||||||||
| 13 | 0 | $unit = lc($unit); | |||||||||||||||||||||||||||
| 14 | 0 | ▶ | return undef unless ref($operand) && ref($operand) eq "DateTime"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $operand and ref $operand eq "DateTime"
MC/DC0%0/2
ref $operand and ref $operand eq "DateTime"
ref $operand
ref $operand eq "DateTime"
Truth table0%0/3
A and B
A= ref $operandB= ref $operand eq "DateTime"
| |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | return $operand unless $unit =~ m/^(days|months|years|weeks|seconds|minutes|hours)$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 0 | return $operand->clone->add( | |||||||||||||||||||||||||||
| 17 | $unit => $number | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 30 | 1; | |||||||||||||||||||||||||||