mirror of
https://github.com/phpbb/phpbb.git
synced 2025-10-04 19:51:39 +02:00
[ticket/17542] Optimize and simplify logic
PHPBB-17542
This commit is contained in:
@@ -24,18 +24,13 @@ class phpbb_mock_event_dispatcher extends \phpbb\event\dispatcher
|
||||
|
||||
public function trigger_event($eventName, $data = array()): array
|
||||
{
|
||||
// Ensure tests never hard-exit when phpBB calls exit_handler()
|
||||
$data = (array) $data;
|
||||
|
||||
if ($eventName === 'core.exit_handler')
|
||||
{
|
||||
// Set the override flag so exit_handler() returns instead of exit;
|
||||
if (is_array($data))
|
||||
{
|
||||
$data['exit_handler_override'] = true;
|
||||
}
|
||||
return (array) $data;
|
||||
}
|
||||
|
||||
// Default behaviour of the mock: return the input data unchanged
|
||||
return (array) $data;
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user