More comment updates, addition of some braces also
authorSam Reed <reedy@users.mediawiki.org>
Sat, 21 May 2011 19:36:03 +0000 (19:36 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 21 May 2011 19:36:03 +0000 (19:36 +0000)
includes/UserArray.php
includes/UserMailer.php
includes/XmlTypeCheck.php

index d48a444..a69df41 100644 (file)
@@ -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__ );
index c27997e..f40e9b8 100644 (file)
@@ -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.
                         */
index a004ef4..78dd259 100644 (file)
@@ -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!