---
title: "analyse/types/invalid-void-cast"
pagination: false
---

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

<RuleId id="analyse/types/invalid-void-cast" />

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-void-cast" = "on"
```

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

## Replaces

- [`VoidCastRule`](https://phpstan.org/error-identifiers/cast.void) (phpstan-classes)
- [`cast.void`](https://phpstan.org/error-identifiers/cast.void) (phpstan)
- [`cast.voidNotSupported`](https://phpstan.org/error-identifiers/cast.voidNotSupported) (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)
