X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=bd989328f4e3a9c304e7619ac65ab571837c4cc5;hb=0a08a3144b46d6f1217eb792bd7b464711c71a22;hp=26c4d0aee4b9b34c74047a3be9e40c7ef2a24b86;hpb=41fa0b12e7c4d38c7e7d20ac099394015ef7a55c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 26c4d0aee4..bd989328f4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -148,6 +148,7 @@ function wfArrayDiff2_cmp( $a, $b ) { * @return array */ function wfArrayFilter( array $arr, callable $callback ) { + wfDeprecated( __FUNCTION__, '1.32' ); return array_filter( $arr, $callback, ARRAY_FILTER_USE_BOTH ); } @@ -160,6 +161,7 @@ function wfArrayFilter( array $arr, callable $callback ) { * @return array */ function wfArrayFilterByKey( array $arr, callable $callback ) { + wfDeprecated( __FUNCTION__, '1.32' ); return array_filter( $arr, $callback, ARRAY_FILTER_USE_KEY ); } @@ -471,7 +473,7 @@ function wfAppendQuery( $url, $query ) { } // Add parameter - if ( false === strpos( $url, '?' ) ) { + if ( strpos( $url, '?' ) === false ) { $url .= '?'; } else { $url .= '&'; @@ -1063,15 +1065,14 @@ function wfLogDBError( $text, array $context = [] ) { /** * Throws a warning that $function is deprecated * - * @param string $function + * @param string $function Function that is deprecated. * @param string|bool $version Version of MediaWiki that the function * was deprecated in (Added in 1.19). - * @param string|bool $component Added in 1.19. + * @param string|bool $component Component to which the function belongs. + * If false, it is assumed the function is in MediaWiki core (Added in 1.19). * @param int $callerOffset How far up the call stack is the original * caller. 2 = function that called the function that called - * wfDeprecated (Added in 1.20) - * - * @return null + * wfDeprecated (Added in 1.20). */ function wfDeprecated( $function, $version = false, $component = false, $callerOffset = 2 ) { MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 ); @@ -3122,7 +3123,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { function wfCanIPUseHTTPS( $ip ) { $canDo = true; Hooks::run( 'CanIPUseHTTPS', [ $ip, &$canDo ] ); - return !!$canDo; + return (bool)$canDo; } /**