From d71578067df121cca2a14f9ce8278156a9e5ab27 Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Tue, 10 Jan 2017 16:20:33 +0200 Subject: [PATCH] Minor: Rename parameter to $collection because it accepts both arrays and objects --- Puc/v4/Utils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Puc/v4/Utils.php b/Puc/v4/Utils.php index c36fb83..b4fd8ea 100644 --- a/Puc/v4/Utils.php +++ b/Puc/v4/Utils.php @@ -6,13 +6,13 @@ if ( !class_exists('Puc_v4_Utils', false) ): /** * Get a value from a nested array or object based on a path. * - * @param array|object|null $array Get an entry from this array. + * @param array|object|null $collection Get an entry from this array. * @param array|string $path A list of array keys in hierarchy order, or a string path like "foo.bar.baz". * @param mixed $default The value to return if the specified path is not found. * @param string $separator Path element separator. Only applies to string paths. * @return mixed */ - public static function get($array, $path, $default = null, $separator = '.') { + public static function get($collection, $path, $default = null, $separator = '.') { if ( is_string($path) ) { $path = explode($separator, $path); } @@ -21,7 +21,7 @@ if ( !class_exists('Puc_v4_Utils', false) ): } //Follow the $path into $input as far as possible. - $currentValue = $array; + $currentValue = $collection; $pathExists = true; foreach ($path as $node) { if ( is_array($currentValue) && isset($currentValue[$node]) ) {