From: Thalia Date: Fri, 15 Feb 2019 19:24:58 +0000 (+0000) Subject: Improve documentation for different block types X-Git-Tag: 1.34.0-rc.0~2811^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=dd5aa60524b5e3569f62def5af87cdb47deb1409;p=lhc%2Fweb%2Fwiklou.git Improve documentation for different block types Clarify the purposes of Block::type and Block::getType Change-Id: I64a2695f430c7718c504edb1fa6531a529c115cf --- diff --git a/includes/Block.php b/includes/Block.php index 85fa3415ce..573ce3dc4c 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -68,7 +68,10 @@ class Block { /** @var int Hack for foreign blocking (CentralAuth) */ private $forcedTargetID; - /** @var int Block::TYPE_ constant. Can only be USER, IP or RANGE internally */ + /** + * @var int Block::TYPE_ constant. After the block has been loaded + * from the database, this can only be USER, IP or RANGE. + */ private $type; /** @var User */ @@ -188,7 +191,7 @@ class Block { } /** - * Load a blocked user from their block id. + * Load a block from the block id. * * @param int $id Block id to search for * @return Block|null @@ -1547,7 +1550,9 @@ class Block { } /** - * Get the type of target for this particular block + * Get the type of target for this particular block. Autoblocks have whichever type + * corresponds to their target, so to detect if a block is an autoblock, we have to + * check the mAuto property instead. * @return int Block::TYPE_ constant, will never be TYPE_ID */ public function getType() {