Le 08/10/13 07:23, Matthew Flaschen a écrit :
There are really two parts of the status class:
* Setting error codes of varying severity (e.g. newGood for success,
newFatal for fatal error, error for a regular error), then letting the
caller check for them (e.g. hasMessage(), isOK and isGood, if it's *not*
okay follow-up with getErrorsArray()). Note that hasMessage uses
internal error codes *not* user-facing errors, so it's a way to check
programmatically if a particular type of error occurred.
* Message formatting with wfMessage and friends; indeed, this whould
probably not be in the class if it were designed today, under single
responsibility principle.
I would investigate if you can use just the first.
Would it make sense to RFC the decoupling of the Status class and get it
split in two parts: Status and StatusFormatter (or whatever).
--
Antoine "hashar" Musso