1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Replace array reduce with foreach loop for PHP 5.3 compat

This commit is contained in:
Aidan Woods 2018-04-06 20:55:27 +01:00
parent 68be90348c
commit 387ef63888
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -1648,14 +1648,14 @@ class Parsedown
protected function elementsApplyRecursive($closure, array $Elements)
{
return array_reduce(
$Elements,
function (array $Elements, array $Element) use ($closure) {
$Elements[] = $this->elementApplyRecursive($closure, $Element);
return $Elements;
},
array()
);
$newElements = array();
foreach ($Elements as $Element)
{
$newElements[] = $this->elementApplyRecursive($closure, $Element);
}
return $newElements;
}
protected function element(array $Element)