IsoCodes
IsoCodes copied to clipboard
Ensure tests pass without warnings in PHP 8.2
Hi @ronanguilloux,
I hope I'm not being too invasive with this PR. If so, feel free to cancel it.
What I'm doing is making sure things work without issues in PHP 8.2 (as tests were throwing a hundreds of warnings). Most of them were due to passing null to PHP native functions that don't support null anymore. To fix those issues, I systematically added statements in the form of:
$value = $value ?? '';
The full summary of what this PR does, is:
- fix many calls to PHP functions where null was being passed although it's deprecated
- update reference to laravel-isocodes-validation as the readme of the previously referenced package redirects to the one I'm pointing now
- declare support for php 8.2 in the readme
- fix call to undefined method PhpCsFixer\Config::create() which was necessary to be able to run make quality
- fix psr-2 coding standard issues to fix issues found by make quality (although they were not introduced by the PR)
As the phpdoc type for those parameters says @param string, the proper fix should be done in the caller IMO, by avoiding the usage of parameter values that don't respect the document contract of the class.