RecentChange: Use constants for the $noudp parameter of save()
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 6 Apr 2018 15:56:07 +0000 (16:56 +0100)
committerKrinkle <krinklemail@gmail.com>
Fri, 27 Apr 2018 22:23:52 +0000 (22:23 +0000)
commiteca112b4e03f24d06f86e2de6bd04149478215b5
tree4b3ba079fddb6fb0ad867fb9ec40dcdc7acb3111
parent59636d1d0c95b2fb86ad93cfc3e25176e730e133
RecentChange: Use constants for the $noudp parameter of save()

It is a boolean parameter that is confusing for three reasons:

* It's a boolean parameter, given parameters are unnamed in PHP,
  these are always poor UX for call sites.

* It's negated ("noudp"). save(true) means no feeds events,
  save(false) [default] means sending events to feeds.

* To overcome this problem, typical use was to pass a free-form
  string that self-documents the intended behaviour,
  e.g. `save('pleasenoudp')`, any string casts to true.

Fix this by moving the booleans to constants and use those
instead. For compatiblity, keep the negation internally,
although it's hidden from regular usage. Also document
the string hack, deprecate it, and update callers.

Change-Id: Ia57c86b38bf50cb4ec580f42a6b1ca798fcf781a
includes/changes/RecentChange.php
includes/logging/LogEntry.php