* @return array
*/
function wfArrayFilter( array $arr, callable $callback ) {
+ wfDeprecated( __FUNCTION__, '1.32' );
return array_filter( $arr, $callback, ARRAY_FILTER_USE_BOTH );
}
* @return array
*/
function wfArrayFilterByKey( array $arr, callable $callback ) {
+ wfDeprecated( __FUNCTION__, '1.32' );
return array_filter( $arr, $callback, ARRAY_FILTER_USE_KEY );
}
*
* @param array $array The array.
* @param array $insert The array to insert.
- * @param mixed $after The key to insert after
+ * @param mixed $after The key to insert after. Callers need to make sure the key is set.
* @return array
*/
function wfArrayInsertAfter( array $array, array $insert, $after ) {
/**
* Get a load balancer object.
*
- * @deprecated since 1.27, use MediaWikiServices::getDBLoadBalancer()
- * or MediaWikiServices::getDBLoadBalancerFactory() instead.
+ * @deprecated since 1.27, use MediaWikiServices::getInstance()->getDBLoadBalancer()
+ * or MediaWikiServices::getInstance()->getDBLoadBalancerFactory() instead.
*
* @param string|bool $wiki Wiki ID, or false for the current wiki
* @return \Wikimedia\Rdbms\LoadBalancer
/**
* Get the load balancer factory object
*
- * @deprecated since 1.27, use MediaWikiServices::getDBLoadBalancerFactory() instead.
+ * @deprecated since 1.27, use MediaWikiServices::getInstance()->getDBLoadBalancerFactory() instead.
*
* @return \Wikimedia\Rdbms\LBFactory
*/
function wfCanIPUseHTTPS( $ip ) {
$canDo = true;
Hooks::run( 'CanIPUseHTTPS', [ $ip, &$canDo ] );
- return !!$canDo;
+ return (bool)$canDo;
}
/**