Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php |
— | — | @@ -352,16 +352,16 @@ |
353 | 353 | /** |
354 | 354 | * Gets a list of element that match a key, optionally using a fallback key. |
355 | 355 | * |
356 | | - * @param {array} $map Map of lists to select from |
| 356 | + * @param {array} $list List of lists to select from |
357 | 357 | * @param {string} $key Key to look for in $map |
358 | | - * @param {string} $fallback Key to look for in map if $key is not in $map |
| 358 | + * @param {string} $fallback Key to look for in $list if $key doesn't exist |
359 | 359 | * @return {array} List of elements from $map which matched $key or $fallback, or an empty list in case of no match |
360 | 360 | */ |
361 | | - protected static function tryForKey( $list, $key, $fallback = null ) { |
| 361 | + protected static function tryForKey( array $list, $key, $fallback = null ) { |
362 | 362 | if ( isset( $list[$key] ) && is_array( $list[$key] ) ) { |
363 | | - return (array) $list[$key]; |
364 | | - } else if ( is_string( $fallback ) && isset( $list[$fallback] ) ) { |
365 | | - return (array) $list[$fallback]; |
| 363 | + return $list[$key]; |
| 364 | + } else if ( is_string( $fallback ) && isset( $list[$fallback] ) && is_array( $list[$fallback] ) ) { |
| 365 | + return $list[$fallback]; |
366 | 366 | } |
367 | 367 | return array(); |
368 | 368 | } |