http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88537
Revision: 88537
Author: reedy
Date: 2011-05-21 19:36:03 +0000 (Sat, 21 May 2011)
Log Message:
-----------
More comment updates, addition of some braces also
Modified Paths:
--------------
trunk/phase3/includes/UserArray.php
trunk/phase3/includes/UserMailer.php
trunk/phase3/includes/XmlTypeCheck.php
Modified: trunk/phase3/includes/UserArray.php
===================================================================
--- trunk/phase3/includes/UserArray.php 2011-05-21 19:35:16 UTC (rev 88536)
+++ trunk/phase3/includes/UserArray.php 2011-05-21 19:36:03 UTC (rev 88537)
@@ -1,6 +1,11 @@
<?php
abstract class UserArray implements Iterator {
+
+ /**
+ * @param $res
+ * @return UserArrayFromResult
+ */
static function newFromResult( $res ) {
$userArray = null;
if ( !wfRunHooks( 'UserArrayFromResult', array( &$userArray,
$res ) ) ) {
@@ -12,11 +17,16 @@
return $userArray;
}
+ /**
+ * @param $ids array
+ * @return UserArrayFromResult
+ */
static function newFromIDs( $ids ) {
$ids = array_map( 'intval', (array)$ids ); // paranoia
- if ( !$ids )
+ if ( !$ids ) {
// Database::select() doesn't like empty arrays
return new ArrayIterator(array());
+ }
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'user', '*', array( 'user_id' => $ids ),
__METHOD__ );
Modified: trunk/phase3/includes/UserMailer.php
===================================================================
--- trunk/phase3/includes/UserMailer.php 2011-05-21 19:35:16 UTC (rev
88536)
+++ trunk/phase3/includes/UserMailer.php 2011-05-21 19:36:03 UTC (rev
88537)
@@ -31,7 +31,7 @@
*/
class MailAddress {
/**
- * @param $address Mixed: string with an email address, or a User object
+ * @param $address string|User string with an email address, or a User
object
* @param $name String: human-readable name if a string address is given
* @param $realName String: human-readable real name if a string
address is given
*/
@@ -82,6 +82,13 @@
/**
* Send mail using a PEAR mailer
+ *
+ * @param $mailer
+ * @param $dest
+ * @param $headers
+ * @param $body
+ *
+ * @return Status
*/
protected static function sendWithPear( $mailer, $dest, $headers, $body
) {
$mailResult = $mailer->send( $dest, $headers, $body );
@@ -138,15 +145,18 @@
require_once( 'Mail.php' );
$msgid = str_replace( " ", "_", microtime() );
- if ( function_exists( 'posix_getpid' ) )
+ if ( function_exists( 'posix_getpid' ) ) {
$msgid .= '.' . posix_getpid();
+ }
if ( is_array( $to ) ) {
$dest = array();
- foreach ( $to as $u )
+ foreach ( $to as $u ) {
$dest[] = $u->address;
- } else
+ }
+ } else {
$dest = $to->address;
+ }
$headers['From'] = $from->toString();
@@ -256,6 +266,8 @@
/**
* Converts a string into a valid RFC 822 "phrase", such as is used for
the sender name
+ * @param $phrase string
+ * @return string
*/
public static function rfc822Phrase( $phrase ) {
$phrase = strtr( $phrase, array( "\r" => '', "\n" => '', '"' =>
'' ) );
@@ -332,8 +344,9 @@
public function notifyOnPageChange( $editor, $title, $timestamp,
$summary, $minorEdit, $oldid = false ) {
global $wgEnotifUseJobQ, $wgEnotifWatchlist,
$wgShowUpdatedMarker;
- if ( $title->getNamespace() < 0 )
+ if ( $title->getNamespace() < 0 ) {
return;
+ }
// Build a list of users to notfiy
$watchers = array();
@@ -385,7 +398,7 @@
}
- /*
+ /**
* Immediate version of notifyOnPageChange().
*
* Send emails corresponding to the user $editor editing the page
$title.
@@ -505,7 +518,7 @@
}
if ( $wgEnotifImpersonal && $this->oldid ) {
- /*
+ /**
* For impersonal mail, show a diff link to the last
* revision.
*/
Modified: trunk/phase3/includes/XmlTypeCheck.php
===================================================================
--- trunk/phase3/includes/XmlTypeCheck.php 2011-05-21 19:35:16 UTC (rev
88536)
+++ trunk/phase3/includes/XmlTypeCheck.php 2011-05-21 19:36:03 UTC (rev
88537)
@@ -34,11 +34,16 @@
/**
* Get the root element. Simple accessor to $rootElement
+ *
+ * @return string
*/
public function getRootElement() {
return $this->rootElement;
}
+ /**
+ * @param $fname
+ */
private function run( $fname ) {
$parser = xml_parser_create_ns( 'UTF-8' );
@@ -65,6 +70,11 @@
xml_parser_free( $parser );
}
+ /**
+ * @param $parser
+ * @param $name
+ * @param $attribs
+ */
private function rootElementOpen( $parser, $name, $attribs ) {
$this->rootElement = $name;
@@ -76,7 +86,12 @@
xml_set_element_handler( $parser, false, false );
}
}
-
+
+ /**
+ * @param $parser
+ * @param $name
+ * @param $attribs
+ */
private function elementOpen( $parser, $name, $attribs ) {
if( call_user_func( $this->filterCallback, $name, $attribs ) ) {
// Filter hit!
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs