Menu

← Back to property.*

Error Identifier: property.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 Library\InternalInterface;

class Foo
{
	/** The interface is marked @internal by the library */
	public InternalInterface $service;
}

Where Library\InternalInterface is:

<?php declare(strict_types = 1);

namespace Library;

/** @internal */
interface InternalInterface
{
	public function execute(): void;
}

Why is it reported? #

A property type references an interface that has been marked as @internal. Internal interfaces are implementation details of their package and are not meant to be used by external code. They may change or be removed without notice in future versions. This can be reported for:

  • Native property type declarations using internal interfaces
  • Accessing a property on an object whose declaring class is an internal interface

How to fix it #

Replace the internal interface with the package’s public API:

 class Foo
 {
-	public InternalInterface $service;
+	public PublicInterface $service;
 }

If no public alternative exists, contact the library maintainers to request a public API for the functionality.

How to ignore this error #

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

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

Rules that report this error #

  • PHPStan\Rules\InternalTag\RestrictedInternalClassNameUsageExtension [1]
  • PHPStan\Rules\InternalTag\RestrictedInternalPropertyUsageExtension [1] [2]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.