- Fix deprecated warning when passing null to str_replace() function\n- Use null coalescing operator to provide empty string as default value\n- Comply with PHP 8.2+ type requirements