Index: trunk/phase3/includes/Block.php |
— | — | @@ -55,10 +55,10 @@ |
56 | 56 | * user ID. Tries the user ID first, and if that doesn't work, tries |
57 | 57 | * the address. |
58 | 58 | * |
| 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 |
59 | 62 | * @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 |
63 | 63 | */ |
64 | 64 | public static function newFromDB( $address, $user = 0, $killExpired = true ) { |
65 | 65 | $block = new Block; |
— | — | @@ -73,8 +73,8 @@ |
74 | 74 | /** |
75 | 75 | * Load a blocked user from their block id. |
76 | 76 | * |
| 77 | + * @param $id Integer: Block id to search for |
77 | 78 | * @return Block object |
78 | | - * @param $id int Block id to search for |
79 | 79 | */ |
80 | 80 | public static function newFromID( $id ) { |
81 | 81 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | /** |
93 | 93 | * Check if two blocks are effectively equal |
94 | 94 | * |
95 | | - * @return bool |
| 95 | + * @return Boolean |
96 | 96 | */ |
97 | 97 | public function equals( Block $block ) { |
98 | 98 | return ( |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | * Get the DB object and set the reference parameter to the select options. |
126 | 126 | * The options array will contain FOR UPDATE if appropriate. |
127 | 127 | * |
128 | | - * @param array $options |
| 128 | + * @param $options Array |
129 | 129 | * @return Database |
130 | 130 | */ |
131 | 131 | protected function &getDBOptions( &$options ) { |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | * @param $address string The IP address of the user, or blank to skip IP blocks |
151 | 151 | * @param $user int The user ID, or zero for anonymous users |
152 | 152 | * @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 |
154 | 154 | * |
155 | 155 | */ |
156 | 156 | public function load( $address = '', $user = 0, $killExpired = true ) { |
— | — | @@ -227,9 +227,9 @@ |
228 | 228 | /** |
229 | 229 | * Fill in member variables from a result wrapper |
230 | 230 | * |
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 |
234 | 234 | */ |
235 | 235 | protected function loadFromResult( ResultWrapper $res, $killExpired = true ) { |
236 | 236 | $ret = false; |
— | — | @@ -266,10 +266,10 @@ |
267 | 267 | * Search the database for any range blocks matching the given address, and |
268 | 268 | * load the row if one is found. |
269 | 269 | * |
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 |
274 | 274 | */ |
275 | 275 | public function loadRange( $address, $killExpired = true, $user = 0 ) { |
276 | 276 | $iaddr = IP::toHex( $address ); |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | * Given a database row from the ipblocks table, initialize |
305 | 305 | * member variables |
306 | 306 | * |
307 | | - * @param $row ResultWrapper A row from the ipblocks table |
| 307 | + * @param $row ResultWrapper: a row from the ipblocks table |
308 | 308 | */ |
309 | 309 | public function initFromRow( $row ) { |
310 | 310 | $this->mAddress = $row->ipb_address; |
— | — | @@ -345,7 +345,7 @@ |
346 | 346 | /** |
347 | 347 | * Delete the row from the IP blocks table. |
348 | 348 | * |
349 | | - * @return bool |
| 349 | + * @return Boolean |
350 | 350 | */ |
351 | 351 | public function delete() { |
352 | 352 | if ( wfReadOnly() ) { |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | * Insert a block into the block table. Will fail if there is a conflicting |
366 | 366 | * block (same name and options) already in the database. |
367 | 367 | * |
368 | | - * @return bool Whether or not the insertion was successful. |
| 368 | + * @return Boolean: whether or not the insertion was successful. |
369 | 369 | */ |
370 | 370 | public function insert() { |
371 | 371 | wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" ); |
— | — | @@ -469,7 +469,7 @@ |
470 | 470 | * Retroactively autoblocks the last IP used by the user (if it is a user) |
471 | 471 | * blocked by this Block. |
472 | 472 | * |
473 | | - * @return bool Whether or not a retroactive autoblock was made. |
| 473 | + * @return Boolean: whether or not a retroactive autoblock was made. |
474 | 474 | */ |
475 | 475 | public function doRetroactiveAutoblock() { |
476 | 476 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -509,8 +509,8 @@ |
510 | 510 | /** |
511 | 511 | * Checks whether a given IP is on the autoblock whitelist. |
512 | 512 | * |
513 | | - * @return bool |
514 | | - * @param string $ip The IP to check |
| 513 | + * @param $ip String: The IP to check |
| 514 | + * @return Boolean |
515 | 515 | */ |
516 | 516 | public static function isWhitelistedFromAutoblocks( $ip ) { |
517 | 517 | global $wgMemc; |
— | — | @@ -552,9 +552,9 @@ |
553 | 553 | /** |
554 | 554 | * Autoblocks the given IP, referring to this Block. |
555 | 555 | * |
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. |
559 | 559 | */ |
560 | 560 | public function doAutoblock( $autoblockIP, $justInserted = false ) { |
561 | 561 | # If autoblocks are disabled, go away. |
— | — | @@ -619,7 +619,7 @@ |
620 | 620 | |
621 | 621 | /** |
622 | 622 | * Check if a block has expired. Delete it if it is. |
623 | | - * @return bool |
| 623 | + * @return Boolean |
624 | 624 | */ |
625 | 625 | public function deleteIfExpired() { |
626 | 626 | $fname = 'Block::deleteIfExpired'; |
— | — | @@ -638,7 +638,7 @@ |
639 | 639 | |
640 | 640 | /** |
641 | 641 | * Has the block expired? |
642 | | - * @return bool |
| 642 | + * @return Boolean |
643 | 643 | */ |
644 | 644 | public function isExpired() { |
645 | 645 | wfDebug( "Block::isExpired() checking current " . wfTimestampNow() . " vs $this->mExpiry\n" ); |
— | — | @@ -651,7 +651,7 @@ |
652 | 652 | |
653 | 653 | /** |
654 | 654 | * Is the block address valid (i.e. not a null string?) |
655 | | - * @return bool |
| 655 | + * @return Boolean |
656 | 656 | */ |
657 | 657 | public function isValid() { |
658 | 658 | return $this->mAddress != ''; |
— | — | @@ -680,7 +680,7 @@ |
681 | 681 | /** |
682 | 682 | * Get the user id of the blocking sysop |
683 | 683 | * |
684 | | - * @return int |
| 684 | + * @return Integer |
685 | 685 | */ |
686 | 686 | public function getBy() { |
687 | 687 | return $this->mBy; |
— | — | @@ -689,7 +689,7 @@ |
690 | 690 | /** |
691 | 691 | * Get the username of the blocking sysop |
692 | 692 | * |
693 | | - * @return string |
| 693 | + * @return String |
694 | 694 | */ |
695 | 695 | public function getByName() { |
696 | 696 | return $this->mByName; |
— | — | @@ -711,7 +711,7 @@ |
712 | 712 | |
713 | 713 | /** |
714 | 714 | * Get the block name, but with autoblocked IPs hidden as per standard privacy policy |
715 | | - * @return string |
| 715 | + * @return String |
716 | 716 | */ |
717 | 717 | public function getRedactedName() { |
718 | 718 | if ( $this->mAuto ) { |
— | — | @@ -724,9 +724,9 @@ |
725 | 725 | /** |
726 | 726 | * Encode expiry for DB |
727 | 727 | * |
728 | | - * @return string |
729 | | - * @param $expiry string Timestamp for expiry, or |
| 728 | + * @param $expiry String: timestamp for expiry, or |
730 | 729 | * @param $db Database object |
| 730 | + * @return String |
731 | 731 | */ |
732 | 732 | public static function encodeExpiry( $expiry, $db ) { |
733 | 733 | if ( $expiry == '' || $expiry == Block::infinity() ) { |
— | — | @@ -739,9 +739,9 @@ |
740 | 740 | /** |
741 | 741 | * Decode expiry which has come from the DB |
742 | 742 | * |
743 | | - * @return string |
744 | | - * @param $expiry string Database expiry format |
| 743 | + * @param $expiry String: Database expiry format |
745 | 744 | * @param $timestampType Requested timestamp format |
| 745 | + * @return String |
746 | 746 | */ |
747 | 747 | public static function decodeExpiry( $expiry, $timestampType = TS_MW ) { |
748 | 748 | if ( $expiry == '' || $expiry == Block::infinity() ) { |
— | — | @@ -754,7 +754,7 @@ |
755 | 755 | /** |
756 | 756 | * Get a timestamp of the expiry for autoblocks |
757 | 757 | * |
758 | | - * @return string |
| 758 | + * @return String |
759 | 759 | */ |
760 | 760 | public static function getAutoblockExpiry( $timestamp ) { |
761 | 761 | global $wgAutoblockExpiry; |
— | — | @@ -764,7 +764,7 @@ |
765 | 765 | /** |
766 | 766 | * Gets rid of uneeded numbers in quad-dotted/octet IP strings |
767 | 767 | * 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 |
769 | 769 | * @return string |
770 | 770 | */ |
771 | 771 | public static function normaliseRange( $range ) { |
— | — | @@ -809,7 +809,7 @@ |
810 | 810 | * is desired. In principle this could be DBMS-dependant, but currently all |
811 | 811 | * supported DBMS's support the string "infinity", so we just use that. |
812 | 812 | * |
813 | | - * @return string |
| 813 | + * @return String |
814 | 814 | */ |
815 | 815 | public static function infinity() { |
816 | 816 | # This is a special keyword for timestamps in PostgreSQL, and |
— | — | @@ -820,8 +820,8 @@ |
821 | 821 | /** |
822 | 822 | * Convert a DB-encoded expiry into a real string that humans can read. |
823 | 823 | * |
824 | | - * @param $encoded_expiry string Database encoded expiry time |
825 | | - * @return string |
| 824 | + * @param $encoded_expiry String: Database encoded expiry time |
| 825 | + * @return String |
826 | 826 | */ |
827 | 827 | public static function formatExpiry( $encoded_expiry ) { |
828 | 828 | static $msg = null; |
— | — | @@ -847,8 +847,8 @@ |
848 | 848 | |
849 | 849 | /** |
850 | 850 | * 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 |
853 | 853 | */ |
854 | 854 | public static function parseExpiryInput( $expiry_input ) { |
855 | 855 | if ( $expiry_input == 'infinite' || $expiry_input == 'indefinite' ) { |