Fix PHP 8 deprecation with required parameters