wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
702 stars 219 forks source link

PHPStan : Discourage the usage of WordPress Options functions inside an object in favor of the `Option` class #7126

Open CrochetFeve0251 opened 5 days ago

CrochetFeve0251 commented 5 days ago

Is your feature request related to a problem? Please describe. For fresh hired developers , it is confusing when they should use the Option class or the base functions.

Describe the solution you'd like To deal with that issue issue we need to create a PHPStan custom that scans for the WordPress Option functions:

check if we are inside a class and then display an error. Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.