Code Inspection: Parameter type
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.
See Type declarations (php.net) and @param (phpdoc.org) for details.
In the following example, the expectArray()
function has the parameter of the array
type but is called with a string
argument.
/**
* @param array $arr
* @return array
*/
function expectArray(array $arr) {
return $arr;
}
expectArray("Foo");
Suppress an inspection in the editor
Place the caret at the highlighted line and press Alt+Enter or click .
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.
Last modified: 11 February 2024