1
0
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:
rxu
2020-10-18 14:47:03 +07:00
parent 36bce1158f
commit ba9fd7f5df
3 changed files with 8 additions and 6 deletions

View File

@@ -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]);
}