From f5565355b92c1ea65cd4e9dfdb0f471fc1844d5a Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 20 Oct 2010 20:56:33 +0000 Subject: [PATCH] Improves on r75055, improving comment accuracy, and removing useless casting. --- includes/resourceloader/ResourceLoaderFileModule.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 58052c8928..71083694fe 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -352,16 +352,16 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { /** * Gets a list of element that match a key, optionally using a fallback key. * - * @param {array} $map Map of lists to select from + * @param {array} $list List of lists to select from * @param {string} $key Key to look for in $map - * @param {string} $fallback Key to look for in map if $key is not in $map + * @param {string} $fallback Key to look for in $list if $key doesn't exist * @return {array} List of elements from $map which matched $key or $fallback, or an empty list in case of no match */ - protected static function tryForKey( $list, $key, $fallback = null ) { + protected static function tryForKey( array $list, $key, $fallback = null ) { if ( isset( $list[$key] ) && is_array( $list[$key] ) ) { - return (array) $list[$key]; - } else if ( is_string( $fallback ) && isset( $list[$fallback] ) ) { - return (array) $list[$fallback]; + return $list[$key]; + } else if ( is_string( $fallback ) && isset( $list[$fallback] ) && is_array( $list[$fallback] ) ) { + return $list[$fallback]; } return array(); } -- 2.20.1