1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-04 11:41:38 +02:00

[ticket/17542] Optimize and simplify logic

PHPBB-17542
This commit is contained in:
Matt Friedman
2025-09-16 13:14:39 -07:00
parent 07d75791be
commit dac58f53d7

View File

@@ -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;
$data['exit_handler_override'] = true;
}
// Default behaviour of the mock: return the input data unchanged
return (array) $data;
return $data;
}
}