| 1 | package Langertha::Skeid::Protocol::RawBody; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 86 | our $VERSION = '0.004'; | |||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: The client's JSON body as it was sent, with one top-level value replaced | ||||||||||||||||||||||||||||||||||||||||||
| 4 | 86 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 86 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 86 | ▶ | use JSON::MaybeXS (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 86 | my $STRING = JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1); | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 324 | ▶ | sub with_top_level { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
with_top_level: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 324 | my ($body, $key, $value) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 324 | ▶ | return undef unless defined($body) && defined($key) && defined($value); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
defined $body and defined $key and defined $value
defined $body and defined $key
MC/DC33%1/3
defined $body and defined $key and defined $value
defined $body
defined $key
defined $value
Truth table50%2/4
A and B and C
A= defined $bodyB= defined $keyC= defined $value
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 323 | ▶ | my $spans = _top_level_spans($body) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 319 | my @hits = grep { $_->{key} eq $key } @$spans; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 319 | ▶ | return undef unless @hits; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 317 | my $replacement = $STRING->encode("$value"); | |||||||||||||||||||||||||||||||||||||||||
| 19 | # Back to front, so the offsets of the earlier spans stay valid. | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 317 | for my $hit (sort { $b->{start} <=> $a->{start} } @hits) { | |||||||||||||||||||||||||||||||||||||||||
| 21 | 319 | substr($body, $hit->{start}, $hit->{length}, $replacement); | |||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 317 | return $body; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | # The members of a JSON object: [{ key, start, length }], key decoded, start/length the byte span | ||||||||||||||||||||||||||||||||||||||||||
| 27 | # of the value. undef when the text is not one well-formed-enough object. This follows structure | ||||||||||||||||||||||||||||||||||||||||||
| 28 | # only -- strings, nesting, separators -- and leaves validating values to the decoder that | ||||||||||||||||||||||||||||||||||||||||||
| 29 | # already accepted the body. | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 755 | ▶ | sub _top_level_spans { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_top_level_spans: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | 755 | my ($json) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 755 | my @spans; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 755 | pos($json) = 0; | |||||||||||||||||||||||||||||||||||||||||
| 34 | 755 | ▶ | $json =~ /\G\s*\{/gc or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 754 | $json =~ /\G\s*/gc; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 754 | ▶ | unless ($json =~ /\G\}/gc) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 753 | while (1) { | |||||||||||||||||||||||||||||||||||||||||
| 38 | 2114 | ▶ | $json =~ /\G\s*("(?:[^"\\]|\\.)*")\s*:\s*/gcs or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 2113 | my $key = eval { $STRING->decode($1) }; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 2113 | ▶ | return undef unless defined $key; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 2113 | my $start = pos($json); | |||||||||||||||||||||||||||||||||||||||||
| 42 | 2113 | ▶ | _skip_value(\$json) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 2113 | push @spans, { key => $key, start => $start, length => pos($json) - $start }; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 2113 | $json =~ /\G\s*/gc; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 2113 | ▶ | next if $json =~ /\G,/gc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 752 | ▶ | last if $json =~ /\G\}/gc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 752 | ▶ | $json =~ /\G\s*\z/gc or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 751 | return \@spans; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | # The elements of a JSON array, as their texts. undef when the text is not one array. | ||||||||||||||||||||||||||||||||||||||||||
| 55 | 7 | ▶ | sub _elements { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_elements: called CC=7 SCAR=19.8
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 7 | my ($json) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 57 | 7 | my @elements; | |||||||||||||||||||||||||||||||||||||||||
| 58 | 7 | pos($json) = 0; | |||||||||||||||||||||||||||||||||||||||||
| 59 | 7 | ▶ | $json =~ /\G\s*\[/gc or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 6 | $json =~ /\G\s*/gc; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 6 | ▶ | unless ($json =~ /\G\]/gc) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | 6 | while (1) { | |||||||||||||||||||||||||||||||||||||||||
| 63 | 7 | $json =~ /\G\s*/gc; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 7 | my $start = pos($json); | |||||||||||||||||||||||||||||||||||||||||
| 65 | 7 | ▶ | _skip_value(\$json) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 7 | push @elements, substr($json, $start, pos($json) - $start); | |||||||||||||||||||||||||||||||||||||||||
| 67 | 7 | $json =~ /\G\s*/gc; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 7 | ▶ | next if $json =~ /\G,/gc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 6 | ▶ | last if $json =~ /\G\]/gc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 6 | ▶ | $json =~ /\G\s*\z/gc or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 6 | return \@elements; | |||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | # The text of one member of an object text -- the last one of that name, as decoders read it. | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 432 | ▶ | sub _member { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_member: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 432 | my ($json, $key) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 80 | 432 | ▶ | my $spans = _top_level_spans($json) or return undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 432 | my ($hit) = reverse grep { $_->{key} eq $key } @$spans; | |||||||||||||||||||||||||||||||||||||||||
| 82 | 432 | ▶ | return $hit ? substr($json, $hit->{start}, $hit->{length}) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | # Moves pos() of the referenced string past one JSON value. | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 2120 | ▶ | sub _skip_value { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_skip_value: called CC=9 SCAR=22.1
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 2120 | my ($ref) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 88 | 2120 | ▶ | return 1 if $$ref =~ /\G"(?:[^"\\]|\\.)*"/gcs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 1203 | ▶ | if ($$ref =~ /\G[\[\{]/gc) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 622 | my $depth = 1; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 622 | ▶ | while ($depth) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | 8788 | ▶ | if ($$ref =~ /\G[^"\[\]\{\}]+/gc) { } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | elsif ($$ref =~ /\G"(?:[^"\\]|\\.)*"/gcs) { } | ||||||||||||||||||||||||||||||||||||||||||
| 94 | 935 | elsif ($$ref =~ /\G[\[\{]/gc) { $depth++ } | |||||||||||||||||||||||||||||||||||||||||
| 95 | 1557 | elsif ($$ref =~ /\G[\]\}]/gc) { $depth-- } | |||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | else { return 0 } | |||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||
| 98 | 622 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 581 | ▶ | return $$ref =~ /\G[^\s,\]\}"\[\{]+/gc ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 423 | ▶ | sub tool_schemas { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tool_schemas: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 423 | my ($body, @path) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 106 | 423 | ▶ | return undef unless defined $body; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 423 | my $tools = _member($body, 'tools'); | |||||||||||||||||||||||||||||||||||||||||
| 108 | 423 | ▶ | my $elements = defined($tools) ? _elements($tools) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | 423 | ▶ | return undef unless $elements; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 6 | my @schemas; | |||||||||||||||||||||||||||||||||||||||||
| 111 | 6 | for my $text (@$elements) { | |||||||||||||||||||||||||||||||||||||||||
| 112 | 7 | for my $key (@path) { | |||||||||||||||||||||||||||||||||||||||||
| 113 | 9 | ▶ | $text = defined($text) ? _member($text, $key) : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||
| 115 | 7 | push @schemas, $text; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 6 | return \@schemas; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | 86 | my $CANONICAL = JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1, canonical => 1); | |||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 11 | ▶ | sub encode_with_schemas { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
encode_with_schemas: called CC=17 SCAR=29.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 11 | my ($body, $texts) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 125 | 11 | ▶ | return undef unless ref($body) eq 'HASH' && ref($texts) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $body eq "HASH" and ref $texts eq "ARRAY"
MC/DC0%0/2
ref $body eq "HASH" and ref $texts eq "ARRAY"
ref $body eq "HASH"
ref $texts eq "ARRAY"
Truth table33%1/3
A and B
A= ref $body eq "HASH"B= ref $texts eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 11 | my $tools = $body->{tools}; | |||||||||||||||||||||||||||||||||||||||||
| 127 | 11 | ▶ | return undef unless ref($tools) eq 'ARRAY' && @$tools && @$tools == @$texts; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
ref $tools eq "ARRAY" and @$tools and @$tools == @$texts
ref $tools eq "ARRAY" and @$tools
MC/DC66%2/3
ref $tools eq "ARRAY" and @$tools and @$tools == @$texts
ref $tools eq "ARRAY"
@$tools
@$tools == @$texts
Truth table75%3/4
A and B and C
A= ref $tools eq "ARRAY"B= @$toolsC= @$tools == @$texts
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 9 | my @spelled; | |||||||||||||||||||||||||||||||||||||||||
| 130 | 9 | for my $i (0 .. $#$tools) { | |||||||||||||||||||||||||||||||||||||||||
| 131 | 9 | my $tool = $tools->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 9 | ▶ | return undef unless ref($tool) eq 'HASH' && ref($tool->{function}) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $tool eq "HASH" and ref $tool->{"function"} eq "HASH"
MC/DC0%0/2
ref $tool eq "HASH" and ref $tool->{"function"} eq "HASH"
ref $tool eq "HASH"
ref $tool->{"function"} eq "HASH"
Truth table33%1/3
A and B
A= ref $tool eq "HASH"B= ref $tool->{"function"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 9 | my %function = %{ $tool->{function} }; | |||||||||||||||||||||||||||||||||||||||||
| 134 | 9 | my @members; | |||||||||||||||||||||||||||||||||||||||||
| 135 | 9 | for my $key (qw(name description)) { | |||||||||||||||||||||||||||||||||||||||||
| 136 | 18 | ▶ | next unless exists $function{$key}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 17 | push @members, qq("$key":) . $CANONICAL->encode(delete $function{$key}); | |||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 9 | ▶ | if (exists $function{parameters}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 9 | my $parameters = delete $function{parameters}; | |||||||||||||||||||||||||||||||||||||||||
| 141 | 9 | my $text = $texts->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 142 | 9 | ▶ | my $same = defined($text) && eval { | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
defined $text && eval {
do {
$CANONICAL->encode($CANONICAL->decode($text)) eq $CANONICAL->encode($parameters)
}
}
MC/DC100%2/2
defined $text && eval {
do {
$CANONICAL->encode($CANONICAL->decode($text)) eq $CANONICAL->encode($parameters)
}
}
defined $text
eval {
do {
$CANONICAL->encode($CANONICAL->decode($text)) eq $CANONICAL->encode($parameters)
}
}
Truth table100%3/3
A && B
A= defined $textB= eval {
do {
$CANONICAL->encode($CANONICAL->decode($text)) eq $CANONICAL->encode($parameters)
}
}
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 8 | $CANONICAL->encode($CANONICAL->decode($text)) eq $CANONICAL->encode($parameters); | |||||||||||||||||||||||||||||||||||||||||
| 144 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 9 | ▶ | push @members, '"parameters":' . ($same ? $text : $CANONICAL->encode($parameters)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 9 | push @members, $STRING->encode($_) . ':' . $CANONICAL->encode($function{$_}) for sort keys %function; | |||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | 9 | my %rest = %$tool; | |||||||||||||||||||||||||||||||||||||||||
| 150 | 9 | delete $rest{function}; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 9 | my $type = delete $rest{type}; | |||||||||||||||||||||||||||||||||||||||||
| 152 | push @spelled, join(',', | ||||||||||||||||||||||||||||||||||||||||||
| 153 | '{"type":' . $CANONICAL->encode($type // 'function'), | ||||||||||||||||||||||||||||||||||||||||||
| 154 | '"function":{' . join(',', @members) . '}', | ||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | map { $STRING->encode($_) . ':' . $CANONICAL->encode($rest{$_}) } sort keys %rest, | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$type // "function"
MC/DC0%0/1
$type // "function"
$type
Truth table50%1/2
A
A= $type
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | ) . '}'; | ||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | 9 | my %rest = %$body; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 9 | delete $rest{tools}; | |||||||||||||||||||||||||||||||||||||||||
| 161 | 9 | my $encoded = $CANONICAL->encode(\%rest); | |||||||||||||||||||||||||||||||||||||||||
| 162 | 9 | my $tools_member = '"tools":[' . join(',', @spelled) . ']'; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 9 | ▶ | substr($encoded, -1, 1, (%rest ? ',' : '') . $tools_member . '}'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 9 | return $encoded; | |||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||
| 167 | 86 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | __END__ | ||||||||||||||||||||||||||||||||||||||||||