Replace call_user_func_array with __invoke