Merge "Fix Block::newLoad for IPv6 range blocks"
[lhc/web/wiklou.git] / includes / Block.php
index 3b23603..3b2d395 100644 (file)
@@ -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,
@@ -393,8 +392,7 @@ class Block {
                                $start = Wikimedia\base_convert( ltrim( $block->getRangeStart(), $prefix ), 16, 10 );
                                $size = log( $end - $start + 1, 2 );
 
-                               # This has the nice property that a /32 block is ranked equally with a
-                               # single-IP block, which is exactly what it is...
+                               # Rank a range block covering a single IP equally with a single-IP block
                                $score = self::TYPE_RANGE - 1 + ( $size / 128 );
 
                        } else {