Refactor response code in AddForm for readability/clarity

Authored by thiemowmde on Dec 19 2017, 3:33 PM.


Refactor response code in AddForm for readability/clarity

This directly follows Ic5d5a83.

The intent is to make this code more readable. For example:

  • $statusValue describes what the meaning of the variable, but not it's

type. The meaning is obvious without the variable name (the relevant
$status->getValue call is in the line directly above). The type is an
array (created in EditEntity::attemptSave).

  • What the "revision" array element contains was not clear. The

getRevisionId call got even marked as unknown, because the IDE can not
figure out what type the array element is. This patch fixes this.

This also changes the order of the elements in the API result to have
the "lastrevid" before "success". This is the same in most existing
Wikibase API modules, and done for consistency. Technically it does
not matter.

Bug: T181253
Change-Id: I82aba97c8f4f2781a08cf9ab122cb3e59cd5300b