Hooks: Introduce Hooks::runWithoutAbort() alongside Hooks::run()
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 19 Aug 2017 00:33:25 +0000 (17:33 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 4 Sep 2017 18:55:42 +0000 (18:55 +0000)
commit08f609d45d2e11185e5e1d78434957ae98940945
tree2790fd9d3231b526723f15afee4b48c5812964de
parentc6acd961c37a7454d93e5c9a7ee1f9782a16abf4
Hooks: Introduce Hooks::runWithoutAbort() alongside Hooks::run()

When used, any hook that tries to abort the event by returning something
other than true or null, will result in a run-time exception.

To make it easier to introduce this opt-in flag, still allow explicit
'true' returns from existing callers.

Also factor out the common code between these methods into a new
private method callHook().

Bug: T173615
Change-Id: I94c7ab656bd1a046410681a810c0a3fd4f72a2e5
includes/Hooks.php
tests/phpunit/includes/HooksTest.php