mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/16549] Fix tests
1. If $service array is empty, $service[0] call will throw fatal error in PHP 8. 2. Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+ 3. Adjust make_clickable() logic to avoid 'Undefined array key 3' error. PHPBB3-16549
This commit is contained in:
@@ -59,7 +59,7 @@ class phpbb_mock_container_builder implements ContainerInterface
|
||||
if ($this->has($id))
|
||||
{
|
||||
$service = $this->services[$id];
|
||||
if (is_array($service) && is_callable($service[0]))
|
||||
if (is_array($service) && isset($service[0]) && is_callable($service[0]))
|
||||
{
|
||||
return call_user_func_array($service[0], $service[1]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user