r64502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64501‎ | r64502 | r64503 >
Date:21:16, 1 April 2010
Author:ialex
Status:ok
Tags:
Comment:
Fixed some doxygen warnings and documented a bit
Modified paths:
  • /trunk/phase3/includes/Status.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Status.php
@@ -24,6 +24,8 @@
2525
2626 /**
2727 * Factory function for fatal errors
 28+ *
 29+ * @param $message String: message name
2830 */
2931 static function newFatal( $message /*, parameters...*/ ) {
3032 $params = func_get_args();
@@ -33,25 +35,52 @@
3436 return $result;
3537 }
3638
 39+ /**
 40+ * Factory function for good results
 41+ *
 42+ * @param $value Mixed
 43+ */
3744 static function newGood( $value = null ) {
3845 $result = new self;
3946 $result->value = $value;
4047 return $result;
4148 }
4249
 50+ /**
 51+ * Change operation result
 52+ *
 53+ * @param $ok Boolean: whether to operation completed
 54+ * @param $value Mixed
 55+ */
4356 function setResult( $ok, $value = null ) {
4457 $this->ok = $ok;
4558 $this->value = $value;
4659 }
4760
 61+ /**
 62+ * Returns whether the operation completed and didn't have any error or
 63+ * warnings
 64+ *
 65+ * @return Boolean
 66+ */
4867 function isGood() {
4968 return $this->ok && !$this->errors;
5069 }
5170
 71+ /**
 72+ * Returns whether the operation completed
 73+ *
 74+ * @return Boolean
 75+ */
5276 function isOK() {
5377 return $this->ok;
5478 }
5579
 80+ /**
 81+ * Add a new warning
 82+ *
 83+ * @param $message String: message name
 84+ */
5685 function warning( $message /*, parameters... */ ) {
5786 $params = array_slice( func_get_args(), 1 );
5887 $this->errors[] = array(
@@ -63,6 +92,8 @@
6493 /**
6594 * Add an error, do not set fatal flag
6695 * This can be used for non-fatal errors
 96+ *
 97+ * @param $message String: message name
6798 */
6899 function error( $message /*, parameters... */ ) {
69100 $params = array_slice( func_get_args(), 1 );
@@ -73,7 +104,10 @@
74105 }
75106
76107 /**
77 - * Add an error and set OK to false, indicating that the operation as a whole was fatal
 108+ * Add an error and set OK to false, indicating that the operation
 109+ * as a whole was fatal
 110+ *
 111+ * @param $message String: message name
78112 */
79113 function fatal( $message /*, parameters... */ ) {
80114 $params = array_slice( func_get_args(), 1 );
@@ -128,9 +162,11 @@
129163
130164 /**
131165 * Get the error list as a wikitext formatted list
132 - * @param string $shortContext A short enclosing context message name, to be used
133 - * when there is a single error
134 - * @param string $longContext A long enclosing context message name, for a list
 166+ *
 167+ * @param $shortContext String: a short enclosing context message name, to
 168+ * be used when there is a single error
 169+ * @param $longContext String: a long enclosing context message name, for a list
 170+ * @return String
135171 */
136172 function getWikiText( $shortContext = false, $longContext = false ) {
137173 if ( count( $this->errors ) == 0 ) {
@@ -167,6 +203,9 @@
168204
169205 /**
170206 * Merge another status object into this one
 207+ *
 208+ * @param $other Other Status object
 209+ * @param $overwriteValue Boolean: whether to override the "value" member
171210 */
172211 function merge( $other, $overwriteValue = false ) {
173212 $this->errors = array_merge( $this->errors, $other->errors );
@@ -178,6 +217,11 @@
179218 $this->failCount += $other->failCount;
180219 }
181220
 221+ /**
 222+ * Get the list of errors (but not warnings)
 223+ *
 224+ * @return Array
 225+ */
182226 function getErrorsArray() {
183227 $result = array();
184228 foreach ( $this->errors as $error ) {
@@ -192,6 +236,9 @@
193237
194238 /**
195239 * Returns true if the specified message is present as a warning or error
 240+ *
 241+ * @param $msg String: message name
 242+ * @return Boolean
196243 */
197244 function hasMessage( $msg ) {
198245 foreach ( $this->errors as $error ) {

Status & tagging log