| blib/lib/WWW/Shopify/Liquid/Filter/Reverse.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 13 | 13 | 100.0 |
| branch | 1 | 2 | 50.0 |
| condition | 1 | 2 | 50.0 |
| subroutine | 5 | 5 | 100.0 |
| pod | 0 | 2 | 0.0 |
| total | 20 | 24 | 83.3 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | #!/usr/bin/perl | ||||||
| 2 | 37 | 37 | 14901 | use strict; | |||
| 37 | 107 | ||||||
| 37 | 1219 | ||||||
| 3 | 37 | 37 | 234 | use warnings; | |||
| 37 | 99 | ||||||
| 37 | 1426 | ||||||
| 4 | |||||||
| 5 | package WWW::Shopify::Liquid::Filter::Reverse; | ||||||
| 6 | 37 | 37 | 241 | use base 'WWW::Shopify::Liquid::Filter'; | |||
| 37 | 94 | ||||||
| 37 | 7461 | ||||||
| 7 | 2 | 2 | 0 | 10 | sub max_arguments { return 0; } | ||
| 8 | sub operate { | ||||||
| 9 | 1 | 1 | 0 | 3 | my ($self, $hash, $operand) = @_; | ||
| 10 | 1 | 50 | 50 | 5 | return undef unless (ref($operand) || '') eq 'ARRAY'; | ||
| 11 | 1 | 5 | return [reverse(@$operand)]; | ||||
| 12 | } | ||||||
| 13 | |||||||
| 14 | 1; |