---
title: "analyse/classes/internal-class-usage"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="analyse/classes/internal-class-usage" />

In the [`analyse-basic`](/docs/rules/presets/analyse-basic) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"classes/internal-class-usage" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`RestrictedInternalClassNameUsageExtension`](https://phpstan.org/error-identifiers/new.internalClass) (phpstan-classes)
- [`catch.internalClass`](https://phpstan.org/error-identifiers/catch.internalClass) (phpstan)
- [`catch.internalEnum`](https://phpstan.org/error-identifiers/catch.internalEnum) (phpstan)
- [`catch.internalInterface`](https://phpstan.org/error-identifiers/catch.internalInterface) (phpstan)
- [`catch.internalTrait`](https://phpstan.org/error-identifiers/catch.internalTrait) (phpstan)
- [`class.extendsInternalClass`](https://phpstan.org/error-identifiers/class.extendsInternalClass) (phpstan)
- [`class.extendsInternalEnum`](https://phpstan.org/error-identifiers/class.extendsInternalEnum) (phpstan)
- [`class.extendsInternalInterface`](https://phpstan.org/error-identifiers/class.extendsInternalInterface) (phpstan)
- [`class.extendsInternalTrait`](https://phpstan.org/error-identifiers/class.extendsInternalTrait) (phpstan)
- [`class.implementsInternalClass`](https://phpstan.org/error-identifiers/class.implementsInternalClass) (phpstan)
- [`class.implementsInternalEnum`](https://phpstan.org/error-identifiers/class.implementsInternalEnum) (phpstan)
- [`class.implementsInternalInterface`](https://phpstan.org/error-identifiers/class.implementsInternalInterface) (phpstan)
- [`class.implementsInternalTrait`](https://phpstan.org/error-identifiers/class.implementsInternalTrait) (phpstan)
- [`enum.implementsInternalClass`](https://phpstan.org/error-identifiers/enum.implementsInternalClass) (phpstan)
- [`enum.implementsInternalEnum`](https://phpstan.org/error-identifiers/enum.implementsInternalEnum) (phpstan)
- [`enum.implementsInternalInterface`](https://phpstan.org/error-identifiers/enum.implementsInternalInterface) (phpstan)
- [`enum.implementsInternalTrait`](https://phpstan.org/error-identifiers/enum.implementsInternalTrait) (phpstan)
- [`instanceof.internalClass`](https://phpstan.org/error-identifiers/instanceof.internalClass) (phpstan)
- [`instanceof.internalEnum`](https://phpstan.org/error-identifiers/instanceof.internalEnum) (phpstan)
- [`instanceof.internalInterface`](https://phpstan.org/error-identifiers/instanceof.internalInterface) (phpstan)
- [`instanceof.internalTrait`](https://phpstan.org/error-identifiers/instanceof.internalTrait) (phpstan)
- [`interface.extendsInternalClass`](https://phpstan.org/error-identifiers/interface.extendsInternalClass) (phpstan)
- [`interface.extendsInternalEnum`](https://phpstan.org/error-identifiers/interface.extendsInternalEnum) (phpstan)
- [`interface.extendsInternalInterface`](https://phpstan.org/error-identifiers/interface.extendsInternalInterface) (phpstan)
- [`interface.extendsInternalTrait`](https://phpstan.org/error-identifiers/interface.extendsInternalTrait) (phpstan)
- [`parameter.internalClass`](https://phpstan.org/error-identifiers/parameter.internalClass) (phpstan)
- [`parameter.internalEnum`](https://phpstan.org/error-identifiers/parameter.internalEnum) (phpstan)
- [`parameter.internalInterface`](https://phpstan.org/error-identifiers/parameter.internalInterface) (phpstan)
- [`parameter.internalTrait`](https://phpstan.org/error-identifiers/parameter.internalTrait) (phpstan)
- [`return.internalClass`](https://phpstan.org/error-identifiers/return.internalClass) (phpstan)
- [`return.internalEnum`](https://phpstan.org/error-identifiers/return.internalEnum) (phpstan)
- [`return.internalInterface`](https://phpstan.org/error-identifiers/return.internalInterface) (phpstan)
- [`return.internalTrait`](https://phpstan.org/error-identifiers/return.internalTrait) (phpstan)
- [`traitUse.internalClass`](https://phpstan.org/error-identifiers/traitUse.internalClass) (phpstan)
- [`traitUse.internalEnum`](https://phpstan.org/error-identifiers/traitUse.internalEnum) (phpstan)
- [`traitUse.internalInterface`](https://phpstan.org/error-identifiers/traitUse.internalInterface) (phpstan)
- [`traitUse.internalTrait`](https://phpstan.org/error-identifiers/traitUse.internalTrait) (phpstan)

[More analyse/classes rules](/docs/rules/analyse/classes) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
