From 53ab743fcfd5966d75390772d7abf9c8bb6b07a4 Mon Sep 17 00:00:00 2001 From: Nico Schoenmaker Date: Thu, 22 Jun 2017 12:37:49 +0200 Subject: [PATCH] Do not use the deprecated create_function function --- lib/config/sfConfigHandler.class.php | 4 +- test/lib/config/sfConfigHandlerTest.php | 56 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 test/lib/config/sfConfigHandlerTest.php diff --git a/lib/config/sfConfigHandler.class.php b/lib/config/sfConfigHandler.class.php index 244a74c34b..2ad6775db6 100644 --- a/lib/config/sfConfigHandler.class.php +++ b/lib/config/sfConfigHandler.class.php @@ -75,7 +75,7 @@ static public function replaceConstants($value) { if (is_array($value)) { - array_walk_recursive($value, create_function('&$value', '$value = sfToolkit::replaceConstants($value);')); + array_walk_recursive($value, function (&$value) { $value = sfToolkit::replaceConstants($value); }); } else { @@ -96,7 +96,7 @@ static public function replacePath($path) { if (is_array($path)) { - array_walk_recursive($path, create_function('&$path', '$path = sfConfigHandler::replacePath($path);')); + array_walk_recursive($path, function (&$path) { $path = sfConfigHandler::replacePath($path); }); } else { diff --git a/test/lib/config/sfConfigHandlerTest.php b/test/lib/config/sfConfigHandlerTest.php new file mode 100644 index 0000000000..9f4e13dfbd --- /dev/null +++ b/test/lib/config/sfConfigHandlerTest.php @@ -0,0 +1,56 @@ +