---
title: "analyse/imports/name-already-in-use"
pagination: false
---

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

<RuleId id="analyse/imports/name-already-in-use" />

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

## Configuration

```toml title="pun.toml"
[analyse.rules]
"imports/name-already-in-use" = "on"
```

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

## Replaces

- [`UsedNamesRule`](https://phpstan.org/error-identifiers/class.nameInUse) (phpstan-classes)
- [`NameAlreadyInUse`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`class.nameInUse`](https://phpstan.org/error-identifiers/class.nameInUse) (phpstan)
- [`enum.nameInUse`](https://phpstan.org/error-identifiers/enum.nameInUse) (phpstan)
- [`interface.nameInUse`](https://phpstan.org/error-identifiers/interface.nameInUse) (phpstan)
- [`trait.nameInUse`](https://phpstan.org/error-identifiers/trait.nameInUse) (phpstan)
- [`use.nameInUse`](https://phpstan.org/error-identifiers/use.nameInUse) (phpstan)

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