This should be wrapped in a `if (method_exists($newHandlerClass, 'onCliTerminate'))` to make sure the symfony version is recent enough.