moodlehq / moodle-cs

Moodle Coding Style
https://github.com/moodlehq/moodle-cs
GNU General Public License v3.0
18 stars 16 forks source link

Analyse if we should start checking (4.4 and up) for setAccessible() reflection uses #159

Open stronk7 opened 7 months ago

stronk7 commented 7 months ago

The setAccessible() methods are, since PHP 8.1 no-op. That implies that, since Moodle 4.4.0 (that requires PHP 8.1), there shouldn't be any use in core.

This issue is about to check if PHPCompatibility already has that and, depending on that, decide how we incorporate that check for us (importing if PHPCompatibility has it, implementing ir here, maybe as part of some deprecated processor, or just manually, we already have some similar sniffs looking for forbidden and other functions...)

Ciao :-)

paulholden commented 7 months ago

This would help to prevent undoing all the work you did in MDL-75952 (which has already started :cry: )

andrewnicols commented 7 months ago

I feel that we would be best to look at doing this with psalm or phpstan. This really feels like a task for static analysis rather than a style sniff.