Closed Jefferson49 closed 6 months ago
Sorry, my issue does not make sense. Just recognized that the method is not a constructor, but rather some kind of static method.
The policy is to fix all deprecations as soon as they are discovered, so thanks for reporting!
This one only affects PHP 7.4, and deprecation notices are suppressed in stable releases. So this would only affect someone using a development version of webtrees on PHP 7.4
The fix would be to add an empty constructor (so that matches the other charts).
After scanning the webtrees code, my IDE reports a deprecated constructor for the ChartSex class: "'ChartSex' has a deprecated constructor. Methods with the same name as their class will not be constructors in a future version of PHP."
I do not know what the webtrees policy is about those kind of deprecations; just want to report it if it might be of any use.
The deprecated constructor, can be found in the following line: https://github.com/fisharebest/webtrees/blob/main/app/Statistics/Google/ChartSex.php#L41
I do not have an overview what kind of risk might be associated with changing the constructor. As far as I can see, the constructor is only used in one other line of code: https://github.com/fisharebest/webtrees/blob/main/app/Statistics/Repository/IndividualRepository.php#L1935