Skip to content

Commit c483d98

Browse files
committed
Revert "Updated Encoder::encodeIndexedArray()"
This reverts commit b5aa0fc.
1 parent e2051f9 commit c483d98

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Encoder.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use ArrayObject;
1111
use const SORT_STRING;
12-
use function array_is_list, array_map, get_object_vars, gettype, implode, ksort, strlen;
12+
use function array_is_list, get_object_vars, ksort, strlen;
1313
use s9e\Bencode\Exceptions\EncodingException;
1414
use stdClass;
1515

@@ -79,7 +79,14 @@ protected static function encodeAssociativeArray(array $array): string
7979

8080
protected static function encodeIndexedArray(array $array): string
8181
{
82-
return 'l' . implode('', array_map(static::class . '::encode', $array)) . 'e';
82+
$str = 'l';
83+
foreach ($array as $v)
84+
{
85+
$str .= static::encode($v);
86+
}
87+
$str .= 'e';
88+
89+
return $str;
8390
}
8491

8592
protected static function encodeObject(object $value): string

0 commit comments

Comments
 (0)