Issue #3232691 by alexpott, longwave: Refactor \Drupal\Core\Ajax\AjaxHelperTrait to not cause deprecations in PHP 8.1