Change Inspection Warning → Error: cannot find that Inspection in the Settings...

Answered

Say I have a function with a mandatory parameter

function f($param) {
 ...
}

and it's called somewhere like that

f();

PhpStorm will show a warning at the '()'s .

The Inspection details are

Required parameter '$param' missing
Inspection info: Reports the parameters passed to a function call, whose types do not match the ones specified in the function definition via type declaration or the PHPDoc @param tag.

I would like that warning to become an error (when a parameter is not optional, it's mandatory...).

But I couldn't find the inspection that matches this exactly, searching "parameter"...

How can I do that (for PHP)?
(without adding a PHPDoc for each function)
Thanks

NB: using the latest stable PS 2020.3.3

 

 

0
3 comments

That's PHP | Type compatibility | Parameter type inspection.

You can find the exact inspection that is showing you the warning this way: https://i.gyazo.com/eb56e1ba1fefce3441f95658c0061297.mp4

1

Ok thanks. Didn't think that "Change signature" would guide me to the Inspection...

Actually, during my search I found this Inspection

Reports the parameters passed to a function call, whose types do not match the ones specified in the function definition via type declaration or the PHPDoc @param tag.

which is indeed the description shown in the details.

But the Inspection setting doesn't mention "Number of parameters" or "Required parameter missing", so I thought it could be another one...

Anyway, will change this one to Error.

Thank you.

 

0

Please sign in to leave a comment.