From 6d13464e06e5044de3f2079108c9f27b9237f5b8 Mon Sep 17 00:00:00 2001 From: abuyoyo Date: Wed, 5 Aug 2020 20:51:15 +0300 Subject: [PATCH] Revert "camelCaseKeys() polyfill" This reverts commit a1a9f22b59d1ac05bc3eecd8933ade8a47ef63fa. --- notice-manager.php | 1 - src/utilities.php | 49 ---------------------------------------------- 2 files changed, 50 deletions(-) delete mode 100644 src/utilities.php diff --git a/notice-manager.php b/notice-manager.php index 0f75cd6..df4ba90 100644 --- a/notice-manager.php +++ b/notice-manager.php @@ -56,7 +56,6 @@ new PluginCore( ] ); -require_once 'src/utilities.php'; require_once 'src/NoticeManager.php'; diff --git a/src/utilities.php b/src/utilities.php deleted file mode 100644 index 1e6c953..0000000 --- a/src/utilities.php +++ /dev/null @@ -1,49 +0,0 @@ - $val) { - $newKey = @explode('_', $key); - //array_walk($newKey, create_function('&$v', '$v = ucwords($v);')); //If you are using PHP 5.3.0 or newer a native anonymous function should be used instead. - array_walk($newKey, function(&$v){$v = ucwords($v);}); - $newKey = @implode('', $newKey); - $newKey = @lcfirst($newKey); //$newKey{0} = strtolower($newKey{0}); - - /* if (! $newKey = @ucwords($key, '_') ) - $newKey = $key; - $newKey = @str_replace('_', '', $newKey); - $newKey = @lcfirst($newKey); */ - - if (!is_array($val)) { - $camelCaseArray[$newKey] = $val; - } else { - //this line throws an 'index undefined' notice - //$camelCaseArray[$newKey] = camelCaseKeys($val, $camelCaseArray[$newKey]); - - //$camelCaseArray[$newKey] = camelCaseKeys($val, $array[$key]); //? this works? why? - //$camelCaseArray[$newKey] = camelCaseKeys($val, $val); //? this works? why? - $camelCaseArray[$newKey] = camelCaseKeys($val); //? this works? why? - } - } - return $camelCaseArray; -} -endif; \ No newline at end of file