phpstan: Possible false error on parameters in methods

Hi guys,

I liked this tool a lot, I’m using on my tests and I received a possible false error on analysis. On my class, method use func_num_args() and func_get_arg() to manage parameters, but this script report error, as below:

------ ---------------------------------------------------------------------------------- 
  Line   vectordev/ajaxtable/examples/numbers.php                                          
 ------ ---------------------------------------------------------------------------------- 
  118    Class VectorDev\AjaxTable\Row constructor invoked with 6 parameters, 0 required.  
 ------ ---------------------------------------------------------------------------------- 

https://github.com/vectornet/ajaxtable/blob/master/examples/numbers.php#L118 https://github.com/vectornet/ajaxtable/blob/master/src/Row.php#L29

I think that in this case why not a good idea to script check if have function handling functions ( func_get_*) in method on validation.

What you think guys? Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@juliangut It’s possible it doesn’t work for traits, I’m gonna look into it.

I do variadic arguments detection by looking for func_get_args() for methods and functions, but unfortunately not for constructors yet. I will fix it soon, until then you can use the variadic arguments syntax ...$args.