---
title: "analyse/debug/assert-type"
pagination: false
---

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

<RuleId id="analyse/debug/assert-type" />

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

## What it does

Reports each `assertType()`, `assertNativeType()`, `assertSuperType()` or `assertVariableCertainty()` call that does not hold. Ignore comments and baselines cannot suppress these diagnostics.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"debug/assert-type" = "on"
```

Ignore comments and baselines cannot suppress it.

## Replaces

- [`FileAssertRule`](https://phpstan.org/error-identifiers/phpstan.nativeType) (phpstan-classes)
- [`phpstan.nativeType`](https://phpstan.org/error-identifiers/phpstan.nativeType) (phpstan)
- [`phpstan.superType`](https://phpstan.org/error-identifiers/phpstan.superType) (phpstan)
- [`phpstan.type`](https://phpstan.org/error-identifiers/phpstan.type) (phpstan)
- [`phpstan.unknownExpectation`](https://phpstan.org/error-identifiers/phpstan.unknownExpectation) (phpstan)
- [`phpstan.variable`](https://phpstan.org/error-identifiers/phpstan.variable) (phpstan)

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