matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.92k stars 2.66k forks source link

[PHP 8.4] Explicitly mark nullable parameters #22693

Closed sgiehl closed 1 month ago

sgiehl commented 1 month ago

Description:

With PHP 8.4 implicitly marking parameters as nullable by only setting null as default value is deprecated. To get rid of all the deprecation notices caused by our code, this PR aims to change all occurrences to explicitly mark the parameters as nullable.

refs #22471

Review

michalkleiner commented 1 month ago

Did you use a tool to convert the params or did you do it manually?

sgiehl commented 1 month ago

@michalkleiner I actually used a regex to find those and fixed them manually. Might be possible that I missed some though. But I didn't want to introduce new type hints on purpose and only fixed those that had an implicit nullable value.

michalkleiner commented 1 month ago

implicit nullable value.

Implicit nullable typed value. Fair enough.