r84498 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84497‎ | r84498 | r84499 >
Date:23:03, 21 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Follow-up r84475: fixing the warning is easy enough... :D Also some random tweaks to Database.php documentation.
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/BlockTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/BlockTest.php
@@ -35,7 +35,7 @@
3636
3737 function testInitializerFunctionsReturnCorrectBlock() {
3838
39 - $this->assertTrue( $this->block->equals( Block::newFromDB('UTBlockee') ), "newFromDB() returns the same block as the one that was made");
 39+ $this->assertTrue( $this->block->equals( Block::newFromTarget('UTBlockee') ), "newFromTarget() returns the same block as the one that was made");
4040
4141 $this->assertTrue( $this->block->equals( Block::newFromID( 1 ) ), "newFromID() returns the same block as the one that was made");
4242
Index: trunk/phase3/includes/db/Database.php
@@ -1119,16 +1119,16 @@
11201120 * @param $table String: table name
11211121 * @param $vars String: the selected variables
11221122 * @param $conds Array: a condition map, terms are ANDed together.
1123 - * Items with numeric keys are taken to be literal conditions
1124 - * Takes an array of selected variables, and a condition map, which is ANDed
1125 - * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" =>
1126 - * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where
1127 - * $obj- >page_id is the ID of the Astronomy article
 1123+ * Items with numeric keys are taken to be literal conditions
 1124+ * Takes an array of selected variables, and a condition map, which is ANDed
 1125+ * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" =>
 1126+ * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where
 1127+ * $obj- >page_id is the ID of the Astronomy article
11281128 * @param $fname String: Calling function name
11291129 * @param $options Array
11301130 * @param $join_conds Array
11311131 *
1132 - * @todo migrate documentation to phpdocumentor format
 1132+ * @return ResultWrapper|Bool
11331133 */
11341134 function selectRow( $table, $vars, $conds, $fname = 'DatabaseBase::selectRow', $options = array(), $join_conds = array() ) {
11351135 $options['LIMIT'] = 1;
@@ -3174,7 +3174,7 @@
31753175 * Fields can be retrieved with $row->fieldname, with fields acting like
31763176 * member variables.
31773177 *
3178 - * @return MySQL row object
 3178+ * @return object
31793179 * @throws DBUnexpectedError Thrown if the database returns an error
31803180 */
31813181 function fetchObject() {
@@ -3185,7 +3185,7 @@
31863186 * Fetch the next row from the given result object, in associative array
31873187 * form. Fields are retrieved with $row['fieldname'].
31883188 *
3189 - * @return MySQL row object
 3189+ * @return Array
31903190 * @throws DBUnexpectedError Thrown if the database returns an error
31913191 */
31923192 function fetchRow() {
Index: trunk/phase3/includes/Block.php
@@ -711,7 +711,7 @@
712712
713713 # It's okay to autoblock. Go ahead and create/insert the block.
714714
715 - $ipblock = Block::newFromDB( $autoblockIP );
 715+ $ipblock = Block::newFromTarget( $autoblockIP );
716716 if ( $ipblock ) {
717717 # If the user is already blocked. Then check if the autoblock would
718718 # exceed the user block. If it would exceed, then do nothing, else

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84475Blame hashar for this giant commit; he teased me for making so many smaller o...happy-melon19:12, 21 March 2011

Status & tagging log