sirbrillig / phpcs-changed

🐘 Run phpcs on files and only report new warnings/errors compared to the previous version.
MIT License
31 stars 11 forks source link

Do not use an optional parameter in LintMessage's constructor #97

Closed xknown closed 11 months ago

xknown commented 11 months ago

Using optional parameters before required parameters is deprecated since PHP 8.0 -- https://www.php.net/manual/en/migration80.deprecated.php

Removing the default value has no effect.

sirbrillig commented 11 months ago

Thanks for spotting that! I think it needs some slight adjustment as now it throws this error:

TypeError: Argument 2 passed to PhpcsChanged\LintMessage::__construct() must be of the type string, null given, called in /home/runner/work/phpcs-changed/phpcs-changed/PhpcsChanged/PhpcsMessagesHelpers.php on line 48

Probably we just need to change that parameter type to ?string.