From: Derick Alangi Date: Mon, 29 Apr 2019 22:26:03 +0000 (+0100) Subject: Block: Type hint Block constructor, follow-up on I37ab858494a173c6982bb X-Git-Tag: 1.34.0-rc.0~1841^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=cf5279806316a6b77ce0ed32de8bf883d5df69ca;p=lhc%2Fweb%2Fwiklou.git Block: Type hint Block constructor, follow-up on I37ab858494a173c6982bb Since 1.26, both options array and individual arguments were accepted but was later removed in I37ab858494a173c6982bb (support for multiple args was dropped) and **only** array of options is accepted from 1.33 since the use of individual arguments all disappeared, see usage below; Usage ===== https://codesearch.wmflabs.org/search/?q=new%20Block%5C(&i=nope&files=&repos= Bug: T220656 Change-Id: Id5266400def9fafbc89d5bdcdb63aed2a63da34d --- diff --git a/includes/Block.php b/includes/Block.php index 3f17d843b8..489cc66244 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -100,7 +100,7 @@ class Block { const TYPE_ID = 5; /** - * Create a new block with specified parameters on a user, IP or IP range. + * Create a new block with specified option parameters on a user, IP or IP range. * * @param array $options Parameters of the block: * address string|User Target user name, User object, IP address or IP range @@ -125,10 +125,9 @@ class Block { * actions, except those specifically allowed by * other block flags * - * @since 1.26 accepts $options array instead of individual parameters; order - * of parameters above reflects the original order + * @since 1.26 $options array */ - function __construct( $options = [] ) { + public function __construct( array $options = [] ) { $defaults = [ 'address' => '', 'user' => null,