Merge "Tidy up conditions for applying a block from a cookie"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 0f0a93b..5f17ad8 100644 (file)
@@ -1037,9 +1037,18 @@ function wfLogDBError( $text, array $context = [] ) {
  * @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).
+ *
+ * @throws Exception If the MediaWiki version number is not a string or boolean.
  */
 function wfDeprecated( $function, $version = false, $component = false, $callerOffset = 2 ) {
-       MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 );
+       if ( is_string( $version ) || is_bool( $version ) ) {
+               MWDebug::deprecated( $function, $version, $component, $callerOffset + 1 );
+       } else {
+               throw new Exception(
+                       "MediaWiki version must either be a string or a boolean. " .
+                       "Example valid version: '1.33'"
+               );
+       }
 }
 
 /**
@@ -2577,19 +2586,6 @@ function wfGetLB( $wiki = false ) {
        }
 }
 
-/**
- * Get the load balancer factory object
- *
- * @deprecated since 1.27, use MediaWikiServices::getInstance()->getDBLoadBalancerFactory() instead.
- * TODO: Remove in MediaWiki 1.35
- *
- * @return \Wikimedia\Rdbms\LBFactory
- */
-function wfGetLBFactory() {
-       wfDeprecated( __METHOD__, '1.27' );
-       return MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
-}
-
 /**
  * Find a file.
  * @deprecated since 1.34, use MediaWikiServices