PhpStorm 2023.2 Help

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

  1. Place the caret at the highlighted line and press Alt+Enter or click the Intention action icon.

  2. Click the arrow next to the inspection you want to suppress and select the necessary suppress action.

Last modified: 16 May 2022