PR Fix PHP Deprecated messages when using php 8.1