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:
parent
68be90348c
commit
387ef63888
@ -1648,14 +1648,14 @@ class Parsedown
|
|||||||
|
|
||||||
protected function elementsApplyRecursive($closure, array $Elements)
|
protected function elementsApplyRecursive($closure, array $Elements)
|
||||||
{
|
{
|
||||||
return array_reduce(
|
$newElements = array();
|
||||||
$Elements,
|
|
||||||
function (array $Elements, array $Element) use ($closure) {
|
foreach ($Elements as $Element)
|
||||||
$Elements[] = $this->elementApplyRecursive($closure, $Element);
|
{
|
||||||
return $Elements;
|
$newElements[] = $this->elementApplyRecursive($closure, $Element);
|
||||||
},
|
}
|
||||||
array()
|
|
||||||
);
|
return $newElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function element(array $Element)
|
protected function element(array $Element)
|
||||||
|
Loading…
Reference in New Issue
Block a user