Menu

← Back to parameter.*

Error Identifier: parameter.internalInterface

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 App;

use Acme\Library\InternalInterface;

function process(InternalInterface $handler): void
{
}

Why is it reported? #

A function or method parameter uses an interface marked with the @internal tag from another package as its type declaration. Internal interfaces are implementation details of the library and are not part of its public API. They may change or be removed in future versions without notice. Using an internal interface as a parameter type creates a dependency on an unstable API.

How to fix it #

Replace the internal interface with a public API type:

 <?php declare(strict_types = 1);
 
 namespace App;

-use Acme\Library\InternalInterface;
+use Acme\Library\PublicInterface;

-function process(InternalInterface $handler): void
+function process(PublicInterface $handler): void
 {
 }

How to ignore this error #

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

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

Rules that report this error #

  • PHPStan\Rules\InternalTag\RestrictedInternalClassNameUsageExtension [1]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.