---
title: "analyse/types/invalid-closure-signature"
pagination: false
---

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

<RuleId id="analyse/types/invalid-closure-signature" />

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

## Configuration

```toml title="pun.toml"
[analyse.rules]
"types/invalid-closure-signature" = "on"
```

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

## Replaces

- [`ExistingClassesInClosureTypehintsRule`](https://phpstan.org/error-identifiers/attribute.target) (phpstan-classes)
- [`TraitInstantiation`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`attribute.target`](https://phpstan.org/error-identifiers/attribute.target) (phpstan)
- [`method.templateTypeNotInParameter`](https://phpstan.org/error-identifiers/method.templateTypeNotInParameter) (phpstan)
- [`parameter.noParent`](https://phpstan.org/error-identifiers/parameter.noParent) (phpstan)
- [`parameter.trait`](https://phpstan.org/error-identifiers/parameter.trait) (phpstan)
- [`parameter.unresolvableNativeType`](https://phpstan.org/error-identifiers/parameter.unresolvableNativeType) (phpstan)
- [`return.noParent`](https://phpstan.org/error-identifiers/return.noParent) (phpstan)
- [`return.trait`](https://phpstan.org/error-identifiers/return.trait) (phpstan)
- [`return.unresolvableNativeType`](https://phpstan.org/error-identifiers/return.unresolvableNativeType) (phpstan)
- [`selfOut.trait`](https://phpstan.org/error-identifiers/selfOut.trait) (phpstan)

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