BryanDavis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/88522
Change subject: Add doc comment to Status explaining use
......................................................................
Add doc comment to Status explaining use
Tim posted a nice explanation of the recommended pattern for using the
Status object to wikitech-l. This change copies that explanation into
the phpdoc comment block of the Status class in an attempt to propagate
the meme.
Change-Id: Ia98543caaa829cad443abf0f0f5038b3de943ef8
---
M includes/Status.php
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/22/88522/1
diff --git a/includes/Status.php b/includes/Status.php
index 7ec1b0f..7a84fed 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -31,6 +31,11 @@
* An operation which is not OK should have errors so that the user can be
* informed as to what went wrong. Calling the fatal() function sets an error
* message and simultaneously switches off the OK flag.
+ *
+ * The recommended pattern for Status objects is to return a Status object
+ * unconditionally, i.e. both on success and on failure -- so that the
+ * developer of the calling code is reminded that the function can fail, and
+ * so that a lack of error-handling will be explicit.
*/
class Status {
var $ok = true;
--
To view, visit https://gerrit.wikimedia.org/r/88522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia98543caaa829cad443abf0f0f5038b3de943ef8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits