diff options
author | Sam Reed <reedy@users.mediawiki.org> | 2011-05-21 19:36:03 +0000 |
---|---|---|
committer | Sam Reed <reedy@users.mediawiki.org> | 2011-05-21 19:36:03 +0000 |
commit | 85a15bea84a095cc1ed967b1091626a4c3763d74 (patch) | |
tree | f1e0a73f179979091b9bc0b77c224e092ea0a9e2 /includes | |
parent | e514478ba52bbae35955dc9b23e9a015aa86cdaf (diff) | |
download | mediawikicore-85a15bea84a095cc1ed967b1091626a4c3763d74.tar.gz mediawikicore-85a15bea84a095cc1ed967b1091626a4c3763d74.zip |
More comment updates, addition of some braces also
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/88537
Diffstat (limited to 'includes')
-rw-r--r-- | includes/UserArray.php | 12 | ||||
-rw-r--r-- | includes/UserMailer.php | 27 | ||||
-rw-r--r-- | includes/XmlTypeCheck.php | 17 |
3 files changed, 47 insertions, 9 deletions
diff --git a/includes/UserArray.php b/includes/UserArray.php index d48a4440bf9f..a69df41ef1ac 100644 --- a/includes/UserArray.php +++ b/includes/UserArray.php @@ -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 @@ abstract class UserArray implements Iterator { 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__ ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index c27997e06e9c..f40e9b8d1b6d 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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 @@ class UserMailer { /** * 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 @@ class UserMailer { 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 @@ class UserMailer { /** * 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 @@ class EmailNotification { 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 @@ class EmailNotification { } - /* + /** * Immediate version of notifyOnPageChange(). * * Send emails corresponding to the user $editor editing the page $title. @@ -505,7 +518,7 @@ class EmailNotification { } if ( $wgEnotifImpersonal && $this->oldid ) { - /* + /** * For impersonal mail, show a diff link to the last * revision. */ diff --git a/includes/XmlTypeCheck.php b/includes/XmlTypeCheck.php index a004ef4d7c04..78dd259dd5dc 100644 --- a/includes/XmlTypeCheck.php +++ b/includes/XmlTypeCheck.php @@ -34,11 +34,16 @@ class XmlTypeCheck { /** * 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 @@ class XmlTypeCheck { xml_parser_free( $parser ); } + /** + * @param $parser + * @param $name + * @param $attribs + */ private function rootElementOpen( $parser, $name, $attribs ) { $this->rootElement = $name; @@ -76,7 +86,12 @@ class XmlTypeCheck { 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! |