Rename IP::isValidBlock to isValidRange, deprecating the former
[lhc/web/wiklou.git] / includes / Block.php
index 2ca56a5..05e97b9 100644 (file)
@@ -44,40 +44,40 @@ class Block {
        public $mParentBlockId;
 
        /** @var int */
-       protected $mId;
+       private $mId;
 
        /** @var bool */
-       protected $mFromMaster;
+       private $mFromMaster;
 
        /** @var bool */
-       protected $mBlockEmail;
+       private $mBlockEmail;
 
        /** @var bool */
-       protected $mDisableUsertalk;
+       private $mDisableUsertalk;
 
        /** @var bool */
-       protected $mCreateAccount;
+       private $mCreateAccount;
 
        /** @var User|string */
-       protected $target;
+       private $target;
 
        /** @var int Hack for foreign blocking (CentralAuth) */
-       protected $forcedTargetID;
+       private $forcedTargetID;
 
        /** @var int Block::TYPE_ constant. Can only be USER, IP or RANGE internally */
-       protected $type;
+       private $type;
 
        /** @var User */
-       protected $blocker;
+       private $blocker;
 
        /** @var bool */
-       protected $isHardblock;
+       private $isHardblock;
 
        /** @var bool */
-       protected $isAutoblocking;
+       private $isAutoblocking;
 
        /** @var string|null */
-       protected $systemBlockType;
+       private $systemBlockType;
 
        # TYPE constants
        const TYPE_USER = 1;
@@ -1354,7 +1354,7 @@ class Block {
                                self::TYPE_IP
                        ];
 
-               } elseif ( IP::isValidBlock( $target ) ) {
+               } elseif ( IP::isValidRange( $target ) ) {
                        # Can't create a User from an IP range
                        return [ IP::sanitizeRange( $target ), self::TYPE_RANGE ];
                }
@@ -1501,7 +1501,7 @@ class Block {
                        return $id;
                }
                $hmac = MWCryptHash::hmac( $id, $secretKey, false );
-               $cookieValue =  $id . '!' . $hmac;
+               $cookieValue = $id . '!' . $hmac;
                return $cookieValue;
        }
 
@@ -1513,7 +1513,7 @@ class Block {
         *
         * @param string $cookieValue The string in which to find the ID.
         *
-        * @return integer|null The block ID, or null if the HMAC is present and invalid.
+        * @return int|null The block ID, or null if the HMAC is present and invalid.
         */
        public static function getIdFromCookieValue( $cookieValue ) {
                // Extract the ID prefix from the cookie value (may be the whole value, if no bang found).