| 1 | #!/usr/bin/perl | ||||||||||
| 2 | 38 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 38 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package WWW::Shopify::Liquid::Filter::Grep; | ||||||||||
| 6 | 38 | ▶ | use base 'WWW::Shopify::Liquid::Filter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 0 | ▶ | sub min_arguments { return 1; } | ||||||||
|
Subroutine
min_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 8 | 0 | ▶ | sub max_arguments { return 1; } | ||||||||
|
Subroutine
max_arguments: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub render { | ||||||||
|
Subroutine
render: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 12 | 0 | my ($self, $renderer, $hash) = @_; | |||||||||
| 13 | 0 | ▶ | my $operand = !$self->is_processed($self->{operand}) ? $self->{operand}->render($renderer, $hash) : $self->{operand}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | my @results = grep { my $result = $self->{arguments}->[0]->render($renderer, { %$hash, op => $_ }); $result; } (ref($operand) ? @$operand : $operand); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 0 | return [@results]; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub optimize { | ||||||||
|
Subroutine
optimize: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 19 | 0 | my ($self, $optimizer, $hash) = @_; | |||||||||
| 20 | 0 | ▶ | $self->{operand} = $self->{operand}->optimize($optimizer, $hash) unless $self->is_processed($self->{operand}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | return $self; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 38 | 1; | |||||||||