r44354 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44353‎ | r44354 | r44355 >
Date:19:54, 9 December 2008
Author:ialex
Status:ok
Tags:
Comment:
fix doxygen warnings
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Block.php
@@ -55,10 +55,10 @@
5656 * user ID. Tries the user ID first, and if that doesn't work, tries
5757 * the address.
5858 *
 59+ * @param $address String: IP address of user/anon
 60+ * @param $user Integer: user id of user
 61+ * @param $killExpired Boolean: delete expired blocks on load
5962 * @return Block Object
60 - * @param $address string IP address of user/anon
61 - * @param $user int User id of user
62 - * @param $killExpired bool Delete expired blocks on load
6363 */
6464 public static function newFromDB( $address, $user = 0, $killExpired = true ) {
6565 $block = new Block;
@@ -73,8 +73,8 @@
7474 /**
7575 * Load a blocked user from their block id.
7676 *
 77+ * @param $id Integer: Block id to search for
7778 * @return Block object
78 - * @param $id int Block id to search for
7979 */
8080 public static function newFromID( $id ) {
8181 $dbr = wfGetDB( DB_SLAVE );
@@ -91,7 +91,7 @@
9292 /**
9393 * Check if two blocks are effectively equal
9494 *
95 - * @return bool
 95+ * @return Boolean
9696 */
9797 public function equals( Block $block ) {
9898 return (
@@ -124,7 +124,7 @@
125125 * Get the DB object and set the reference parameter to the select options.
126126 * The options array will contain FOR UPDATE if appropriate.
127127 *
128 - * @param array $options
 128+ * @param $options Array
129129 * @return Database
130130 */
131131 protected function &getDBOptions( &$options ) {
@@ -149,7 +149,7 @@
150150 * @param $address string The IP address of the user, or blank to skip IP blocks
151151 * @param $user int The user ID, or zero for anonymous users
152152 * @param $killExpired bool Whether to delete expired rows while loading
153 - * @return bool The user is blocked from editing
 153+ * @return Boolean: the user is blocked from editing
154154 *
155155 */
156156 public function load( $address = '', $user = 0, $killExpired = true ) {
@@ -227,9 +227,9 @@
228228 /**
229229 * Fill in member variables from a result wrapper
230230 *
231 - * @return bool
232 - * @param $res ResultWrapper Row from the ipblocks table
233 - * @param $killExpired bool Whether to delete expired rows while loading
 231+ * @param $res ResultWrapper: row from the ipblocks table
 232+ * @param $killExpired Boolean: whether to delete expired rows while loading
 233+ * @return Boolean
234234 */
235235 protected function loadFromResult( ResultWrapper $res, $killExpired = true ) {
236236 $ret = false;
@@ -266,10 +266,10 @@
267267 * Search the database for any range blocks matching the given address, and
268268 * load the row if one is found.
269269 *
270 - * @return bool
271 - * @param $address string IP address range
272 - * @param $killExpired bool Whether to delete expired rows while loading
273 - * @param $userid int If not 0, then sets ipb_anon_only
 270+ * @param $address String: IP address range
 271+ * @param $killExpired Boolean: whether to delete expired rows while loading
 272+ * @param $userid Integer: if not 0, then sets ipb_anon_only
 273+ * @return Boolean
274274 */
275275 public function loadRange( $address, $killExpired = true, $user = 0 ) {
276276 $iaddr = IP::toHex( $address );
@@ -303,7 +303,7 @@
304304 * Given a database row from the ipblocks table, initialize
305305 * member variables
306306 *
307 - * @param $row ResultWrapper A row from the ipblocks table
 307+ * @param $row ResultWrapper: a row from the ipblocks table
308308 */
309309 public function initFromRow( $row ) {
310310 $this->mAddress = $row->ipb_address;
@@ -345,7 +345,7 @@
346346 /**
347347 * Delete the row from the IP blocks table.
348348 *
349 - * @return bool
 349+ * @return Boolean
350350 */
351351 public function delete() {
352352 if ( wfReadOnly() ) {
@@ -364,7 +364,7 @@
365365 * Insert a block into the block table. Will fail if there is a conflicting
366366 * block (same name and options) already in the database.
367367 *
368 - * @return bool Whether or not the insertion was successful.
 368+ * @return Boolean: whether or not the insertion was successful.
369369 */
370370 public function insert() {
371371 wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" );
@@ -469,7 +469,7 @@
470470 * Retroactively autoblocks the last IP used by the user (if it is a user)
471471 * blocked by this Block.
472472 *
473 - * @return bool Whether or not a retroactive autoblock was made.
 473+ * @return Boolean: whether or not a retroactive autoblock was made.
474474 */
475475 public function doRetroactiveAutoblock() {
476476 $dbr = wfGetDB( DB_SLAVE );
@@ -509,8 +509,8 @@
510510 /**
511511 * Checks whether a given IP is on the autoblock whitelist.
512512 *
513 - * @return bool
514 - * @param string $ip The IP to check
 513+ * @param $ip String: The IP to check
 514+ * @return Boolean
515515 */
516516 public static function isWhitelistedFromAutoblocks( $ip ) {
517517 global $wgMemc;
@@ -552,9 +552,9 @@
553553 /**
554554 * Autoblocks the given IP, referring to this Block.
555555 *
556 - * @param string $autoblockIP The IP to autoblock.
557 - * @param bool $justInserted The main block was just inserted
558 - * @return bool Whether or not an autoblock was inserted.
 556+ * @param $autoblockIP String: the IP to autoblock.
 557+ * @param $justInserted Boolean: the main block was just inserted
 558+ * @return Boolean: whether or not an autoblock was inserted.
559559 */
560560 public function doAutoblock( $autoblockIP, $justInserted = false ) {
561561 # If autoblocks are disabled, go away.
@@ -619,7 +619,7 @@
620620
621621 /**
622622 * Check if a block has expired. Delete it if it is.
623 - * @return bool
 623+ * @return Boolean
624624 */
625625 public function deleteIfExpired() {
626626 $fname = 'Block::deleteIfExpired';
@@ -638,7 +638,7 @@
639639
640640 /**
641641 * Has the block expired?
642 - * @return bool
 642+ * @return Boolean
643643 */
644644 public function isExpired() {
645645 wfDebug( "Block::isExpired() checking current " . wfTimestampNow() . " vs $this->mExpiry\n" );
@@ -651,7 +651,7 @@
652652
653653 /**
654654 * Is the block address valid (i.e. not a null string?)
655 - * @return bool
 655+ * @return Boolean
656656 */
657657 public function isValid() {
658658 return $this->mAddress != '';
@@ -680,7 +680,7 @@
681681 /**
682682 * Get the user id of the blocking sysop
683683 *
684 - * @return int
 684+ * @return Integer
685685 */
686686 public function getBy() {
687687 return $this->mBy;
@@ -689,7 +689,7 @@
690690 /**
691691 * Get the username of the blocking sysop
692692 *
693 - * @return string
 693+ * @return String
694694 */
695695 public function getByName() {
696696 return $this->mByName;
@@ -711,7 +711,7 @@
712712
713713 /**
714714 * Get the block name, but with autoblocked IPs hidden as per standard privacy policy
715 - * @return string
 715+ * @return String
716716 */
717717 public function getRedactedName() {
718718 if ( $this->mAuto ) {
@@ -724,9 +724,9 @@
725725 /**
726726 * Encode expiry for DB
727727 *
728 - * @return string
729 - * @param $expiry string Timestamp for expiry, or
 728+ * @param $expiry String: timestamp for expiry, or
730729 * @param $db Database object
 730+ * @return String
731731 */
732732 public static function encodeExpiry( $expiry, $db ) {
733733 if ( $expiry == '' || $expiry == Block::infinity() ) {
@@ -739,9 +739,9 @@
740740 /**
741741 * Decode expiry which has come from the DB
742742 *
743 - * @return string
744 - * @param $expiry string Database expiry format
 743+ * @param $expiry String: Database expiry format
745744 * @param $timestampType Requested timestamp format
 745+ * @return String
746746 */
747747 public static function decodeExpiry( $expiry, $timestampType = TS_MW ) {
748748 if ( $expiry == '' || $expiry == Block::infinity() ) {
@@ -754,7 +754,7 @@
755755 /**
756756 * Get a timestamp of the expiry for autoblocks
757757 *
758 - * @return string
 758+ * @return String
759759 */
760760 public static function getAutoblockExpiry( $timestamp ) {
761761 global $wgAutoblockExpiry;
@@ -764,7 +764,7 @@
765765 /**
766766 * Gets rid of uneeded numbers in quad-dotted/octet IP strings
767767 * For example, 127.111.113.151/24 -> 127.111.113.0/24
768 - * @param $range string IP address to normalize
 768+ * @param $range String: IP address to normalize
769769 * @return string
770770 */
771771 public static function normaliseRange( $range ) {
@@ -809,7 +809,7 @@
810810 * is desired. In principle this could be DBMS-dependant, but currently all
811811 * supported DBMS's support the string "infinity", so we just use that.
812812 *
813 - * @return string
 813+ * @return String
814814 */
815815 public static function infinity() {
816816 # This is a special keyword for timestamps in PostgreSQL, and
@@ -820,8 +820,8 @@
821821 /**
822822 * Convert a DB-encoded expiry into a real string that humans can read.
823823 *
824 - * @param $encoded_expiry string Database encoded expiry time
825 - * @return string
 824+ * @param $encoded_expiry String: Database encoded expiry time
 825+ * @return String
826826 */
827827 public static function formatExpiry( $encoded_expiry ) {
828828 static $msg = null;
@@ -847,8 +847,8 @@
848848
849849 /**
850850 * Convert a typed-in expiry time into something we can put into the database.
851 - * @param $expiry_input string Whatever was typed into the form
852 - * @return string More database friendly
 851+ * @param $expiry_input String: whatever was typed into the form
 852+ * @return String: more database friendly
853853 */
854854 public static function parseExpiryInput( $expiry_input ) {
855855 if ( $expiry_input == 'infinite' || $expiry_input == 'indefinite' ) {

Status & tagging log