From: Matthias Schmidt Date: Fri, 22 May 2015 16:44:10 +0000 (+0200) Subject: Replace array_walk with array_map in 512b71762e X-Git-Tag: 3.0.0_Beta_1~2353 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62ba0950e143fbbacf82b732349d796db0d47fd3;p=GitHub%2FWoltLab%2FWCF.git Replace array_walk with array_map in 512b71762e --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php index 185049c890..81bff15522 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php @@ -39,18 +39,18 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder { if ($templateListener->options) { $options = explode(',', strtoupper($templateListener->options)); - array_walk($options, function(&$value, $key) { - $value = "('".$value."'|defined && '".$value."'|constant)"; - }); + $options = array_map(function($value) { + return "('".$value."'|defined && '".$value."'|constant)"; + }, $options); $templateCode .= '('.implode(' || ', $options).')'; } if ($templateListener->permissions) { $permissions = explode(',', $templateListener->permissions); - array_walk($permissions, function(&$value, $key) { - $value = "\$__wcf->session->getPermission('".$value."')"; - }); + $permissions = array_map(function($value) { + return "\$__wcf->session->getPermission('".$value."')"; + }, $permissions); if (!empty($options)) { $templateCode .= " && ";