Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | */ |
33 | 33 | class MailAddress { |
34 | 34 | /** |
35 | | - * @param $address Mixed: string with an email address, or a User object |
| 35 | + * @param $address string|User string with an email address, or a User object |
36 | 36 | * @param $name String: human-readable name if a string address is given |
37 | 37 | * @param $realName String: human-readable real name if a string address is given |
38 | 38 | */ |
— | — | @@ -82,6 +82,13 @@ |
83 | 83 | |
84 | 84 | /** |
85 | 85 | * Send mail using a PEAR mailer |
| 86 | + * |
| 87 | + * @param $mailer |
| 88 | + * @param $dest |
| 89 | + * @param $headers |
| 90 | + * @param $body |
| 91 | + * |
| 92 | + * @return Status |
86 | 93 | */ |
87 | 94 | protected static function sendWithPear( $mailer, $dest, $headers, $body ) { |
88 | 95 | $mailResult = $mailer->send( $dest, $headers, $body ); |
— | — | @@ -138,15 +145,18 @@ |
139 | 146 | require_once( 'Mail.php' ); |
140 | 147 | |
141 | 148 | $msgid = str_replace( " ", "_", microtime() ); |
142 | | - if ( function_exists( 'posix_getpid' ) ) |
| 149 | + if ( function_exists( 'posix_getpid' ) ) { |
143 | 150 | $msgid .= '.' . posix_getpid(); |
| 151 | + } |
144 | 152 | |
145 | 153 | if ( is_array( $to ) ) { |
146 | 154 | $dest = array(); |
147 | | - foreach ( $to as $u ) |
| 155 | + foreach ( $to as $u ) { |
148 | 156 | $dest[] = $u->address; |
149 | | - } else |
| 157 | + } |
| 158 | + } else { |
150 | 159 | $dest = $to->address; |
| 160 | + } |
151 | 161 | |
152 | 162 | $headers['From'] = $from->toString(); |
153 | 163 | |
— | — | @@ -256,6 +266,8 @@ |
257 | 267 | |
258 | 268 | /** |
259 | 269 | * Converts a string into a valid RFC 822 "phrase", such as is used for the sender name |
| 270 | + * @param $phrase string |
| 271 | + * @return string |
260 | 272 | */ |
261 | 273 | public static function rfc822Phrase( $phrase ) { |
262 | 274 | $phrase = strtr( $phrase, array( "\r" => '', "\n" => '', '"' => '' ) ); |
— | — | @@ -332,8 +344,9 @@ |
333 | 345 | public function notifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid = false ) { |
334 | 346 | global $wgEnotifUseJobQ, $wgEnotifWatchlist, $wgShowUpdatedMarker; |
335 | 347 | |
336 | | - if ( $title->getNamespace() < 0 ) |
| 348 | + if ( $title->getNamespace() < 0 ) { |
337 | 349 | return; |
| 350 | + } |
338 | 351 | |
339 | 352 | // Build a list of users to notfiy |
340 | 353 | $watchers = array(); |
— | — | @@ -385,7 +398,7 @@ |
386 | 399 | |
387 | 400 | } |
388 | 401 | |
389 | | - /* |
| 402 | + /** |
390 | 403 | * Immediate version of notifyOnPageChange(). |
391 | 404 | * |
392 | 405 | * Send emails corresponding to the user $editor editing the page $title. |
— | — | @@ -505,7 +518,7 @@ |
506 | 519 | } |
507 | 520 | |
508 | 521 | if ( $wgEnotifImpersonal && $this->oldid ) { |
509 | | - /* |
| 522 | + /** |
510 | 523 | * For impersonal mail, show a diff link to the last |
511 | 524 | * revision. |
512 | 525 | */ |
Index: trunk/phase3/includes/XmlTypeCheck.php |
— | — | @@ -34,11 +34,16 @@ |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Get the root element. Simple accessor to $rootElement |
| 38 | + * |
| 39 | + * @return string |
38 | 40 | */ |
39 | 41 | public function getRootElement() { |
40 | 42 | return $this->rootElement; |
41 | 43 | } |
42 | 44 | |
| 45 | + /** |
| 46 | + * @param $fname |
| 47 | + */ |
43 | 48 | private function run( $fname ) { |
44 | 49 | $parser = xml_parser_create_ns( 'UTF-8' ); |
45 | 50 | |
— | — | @@ -65,6 +70,11 @@ |
66 | 71 | xml_parser_free( $parser ); |
67 | 72 | } |
68 | 73 | |
| 74 | + /** |
| 75 | + * @param $parser |
| 76 | + * @param $name |
| 77 | + * @param $attribs |
| 78 | + */ |
69 | 79 | private function rootElementOpen( $parser, $name, $attribs ) { |
70 | 80 | $this->rootElement = $name; |
71 | 81 | |
— | — | @@ -76,7 +86,12 @@ |
77 | 87 | xml_set_element_handler( $parser, false, false ); |
78 | 88 | } |
79 | 89 | } |
80 | | - |
| 90 | + |
| 91 | + /** |
| 92 | + * @param $parser |
| 93 | + * @param $name |
| 94 | + * @param $attribs |
| 95 | + */ |
81 | 96 | private function elementOpen( $parser, $name, $attribs ) { |
82 | 97 | if( call_user_func( $this->filterCallback, $name, $attribs ) ) { |
83 | 98 | // Filter hit! |
Index: trunk/phase3/includes/UserArray.php |
— | — | @@ -1,6 +1,11 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | abstract class UserArray implements Iterator { |
| 5 | + |
| 6 | + /** |
| 7 | + * @param $res |
| 8 | + * @return UserArrayFromResult |
| 9 | + */ |
5 | 10 | static function newFromResult( $res ) { |
6 | 11 | $userArray = null; |
7 | 12 | if ( !wfRunHooks( 'UserArrayFromResult', array( &$userArray, $res ) ) ) { |
— | — | @@ -12,11 +17,16 @@ |
13 | 18 | return $userArray; |
14 | 19 | } |
15 | 20 | |
| 21 | + /** |
| 22 | + * @param $ids array |
| 23 | + * @return UserArrayFromResult |
| 24 | + */ |
16 | 25 | static function newFromIDs( $ids ) { |
17 | 26 | $ids = array_map( 'intval', (array)$ids ); // paranoia |
18 | | - if ( !$ids ) |
| 27 | + if ( !$ids ) { |
19 | 28 | // Database::select() doesn't like empty arrays |
20 | 29 | return new ArrayIterator(array()); |
| 30 | + } |
21 | 31 | $dbr = wfGetDB( DB_SLAVE ); |
22 | 32 | $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ), |
23 | 33 | __METHOD__ ); |