refactoring.

This commit is contained in:
Taylor Otwell
2011-09-06 23:29:19 -05:00
parent 16716097c6
commit ed9e04db6f
9 changed files with 174 additions and 24 deletions

View File

@@ -9,6 +9,14 @@ class Arr {
* also be accessed using JavaScript "dot" style notation. Retrieving items nested
* in multiple arrays is supported.
*
* <code>
* // Get the "name" item from the array
* $name = Arr::get(array('name' => 'Fred'), 'name');
*
* // Get the "age" item from the array, or return 25 if it doesn't exist
* $name = Arr::get(array('name' => 'Fred'), 'age', 25);
* </code>
*
* @param array $array
* @param string $key
* @param mixed $default
@@ -38,6 +46,11 @@ class Arr {
* a variable depth, such as configuration arrays. Like the Arr::get
* method, JavaScript "dot" syntax is supported.
*
* <code>
* // Set the "name" item to "Fred" in the array
* Arr::set($array, 'name', 'Fred');
* </code>
*
* @param array $array
* @param string $key
* @param mixed $value