awesomemotive / wpforms-phpcs

PHP Coding Standards used by the WPForms team.
https://wpforms.com
GNU General Public License v2.0
12 stars 1 forks source link

$this->define() method is treated as define() function #47

Open slaFFik opened 8 months ago

slaFFik commented 8 months ago

Expected Behavior

I think the code should differentiate between a class method and a global function. This may happen with other methods as well that share the same name as a global native PHP function.

Current Behavior

I faced this case:

$this->define( 'SOME_CONSTANT', $this->some_value );

wpforms-phpcs reports this error:

WPForms.Comments.PHPDocDefine.MissPHPDoc: Add the PHPDoc for the define function.

Screenshots

image
jrfoell commented 7 months ago

OK to to work on this when we have time - not high priority.