---
title: "analyse/phpdoc/type-mismatch"
pagination: false
---

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

<RuleId id="analyse/phpdoc/type-mismatch" />

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

## Configuration

```toml title="pun.toml"
[analyse.rules]
"phpdoc/type-mismatch" = "on"
```

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

## Replaces

- [`IncompatiblePhpDocTypeRule`](https://phpstan.org/error-identifiers/callable.shadowTemplate) (phpstan-classes)
- [`DocblockTypeMismatch`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`paramClosureThis.nonClosure`](https://phpstan.org/error-identifiers/paramClosureThis.nonClosure) (phpstan)
- [`parameter.phpDocType`](https://phpstan.org/error-identifiers/parameter.phpDocType) (phpstan)
- [`parameter.unresolvableType`](https://phpstan.org/error-identifiers/parameter.unresolvableType) (phpstan)
- [`return.phpDocType`](https://phpstan.org/error-identifiers/return.phpDocType) (phpstan)
- [`return.unresolvableType`](https://phpstan.org/error-identifiers/return.unresolvableType) (phpstan)

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