Menu

Error Identifier: parameter.internalEnum

← Back to 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);

namespace Vendor {
	/** @internal */
	enum InternalStatus: string {
		case Active = 'active';
	}
}

namespace App {
	function process(\Vendor\InternalStatus $status): void {}
}

Why is it reported? #

The parameter type hint references an enum that is marked as @internal. Internal enums are not part of the public API and are intended for use only within the package or namespace where they are defined. Using an internal enum as a parameter type outside its root namespace means the code depends on an implementation detail that may change or be removed without notice.

How to fix it #

Use the public API provided by the package instead of referencing internal enums directly:

 namespace App {
-	function process(\Vendor\InternalStatus $status): void {}
+	function process(\Vendor\PublicStatus $status): void {}
 }

If no public alternative exists, consider reaching out to the package maintainers to request a public API for the functionality needed.

How to ignore this error #

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

// @phpstan-ignore parameter.internalEnum
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: parameter.internalEnum

Rules that report this error #

  • PHPStan\Rules\InternalTag\RestrictedInternalClassNameUsageExtension [1]
Theme
A
© 2026 PHPStan s.r.o.