website/errors/staticProperty.internal.md
<?php declare(strict_types = 1);
namespace ThirdParty {
class Config {
/** @internal */
public static string $secretKey = 'abc';
}
}
namespace App {
$key = \ThirdParty\Config::$secretKey;
}
A static property that is marked as @internal is being accessed from outside the package that defines it. Internal properties are implementation details not meant to be part of the public API. They may change or be removed in any version without notice.
This error can occur when:
@internal tag.Use the public API of the package instead of accessing internal static properties:
<?php declare(strict_types = 1);
namespace App;
-use ThirdParty\Config;
+use ThirdParty\Settings;
-$key = Config::$secretKey;
+$key = Settings::getApiKey();
If the property is internal to your own project, the error will not be reported when accessing it from within the same root namespace.