From 28c6ac93ef6ef1cd3de5f0219def04709e1c9a2a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 2 Aug 2011 13:41:57 -0500 Subject: [PATCH] Scrap Arr::dot and put dot notation support in Arr::get. --- system/arr.php | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/system/arr.php b/system/arr.php index 5c2338b8..67e63e09 100644 --- a/system/arr.php +++ b/system/arr.php @@ -5,7 +5,8 @@ class Arr { /** * Get an item from an array. * - * If the specified key is null, the entire array will be returned. + * If the specified key is null, the entire array will be returned. The array may + * also be accessed using JavaScript "dot" style notation. * * @param array $array * @param string $key @@ -19,29 +20,6 @@ class Arr { return $array; } - if (array_key_exists($key, $array)) - { - return $array[$key]; - } - - return is_callable($default) ? call_user_func($default) : $default; - } - - /** - * Get an item from an array using JavaScript style "dot" notation. - * - * @param array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function dot($array, $key, $default = null) - { - if (is_null($key)) - { - return $array; - } - foreach (explode('.', $key) as $segment) { if ( ! isset($array[$segment]))