mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #606 from erusev/revert-605-fix/this-php5.3-compat
Replace fix in "Explicitly capture $this for PHP 5.3"
This commit is contained in:
commit
f50ba3d803
@ -1648,17 +1648,14 @@ class Parsedown
|
||||
|
||||
protected function elementsApplyRecursive($closure, array $Elements)
|
||||
{
|
||||
# PHP 5.3 compat
|
||||
$instance = $this;
|
||||
$newElements = array();
|
||||
|
||||
return array_reduce(
|
||||
$Elements,
|
||||
function (array $Elements, array $Element) use ($instance, $closure) {
|
||||
$Elements[] = $instance->elementApplyRecursive($closure, $Element);
|
||||
return $Elements;
|
||||
},
|
||||
array()
|
||||
);
|
||||
foreach ($Elements as $Element)
|
||||
{
|
||||
$newElements[] = $this->elementApplyRecursive($closure, $Element);
|
||||
}
|
||||
|
||||
return $newElements;
|
||||
}
|
||||
|
||||
protected function element(array $Element)
|
||||
|
Loading…
Reference in New Issue
Block a user