Menu

← Back to missingType.*

Error Identifier: missingType.parameter

Every error reported by PHPStan has an error identifier. Here’s a list of all error identifiers. In PHPStan Pro you can see the error identifier next to each error and filter errors by their identifiers.

Code example #

<?php declare(strict_types = 1);

function processData($value): bool
{
	return $value !== null;
}

Why is it reported? #

A function or method parameter has no type specified, either as a native type declaration or a PHPDoc @param tag. Without a type, PHPStan treats the parameter as mixed and cannot perform accurate type checking on how it is used within the function or what values callers pass to it.

How to fix it #

Add a native type declaration to the parameter:

 <?php declare(strict_types = 1);
 
-function processData($value): bool
+function processData(mixed $value): bool
 {
 	return $value !== null;
 }

Or add a PHPDoc @param tag with a more specific type:

 <?php declare(strict_types = 1);
 
+/** @param string|int $value */
 function processData($value): bool
 {
 	return $value !== null;
 }

How to ignore this error #

You can use the identifier missingType.parameter to ignore this error using a comment:

// @phpstan-ignore missingType.parameter
codeThatProducesTheError();

You can also use only the identifier key to ignore all errors of the same type in your configuration file in the ignoreErrors parameter:

parameters:
	ignoreErrors:
		-
			identifier: missingType.parameter

Rules that report this error #

  • PHPStan\Rules\Functions\MissingFunctionParameterTypehintRule [1]
  • PHPStan\Rules\Methods\MissingMethodParameterTypehintRule [1]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.