---
title: "analyse/statements/invalid-empty"
pagination: false
---

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

<RuleId id="analyse/statements/invalid-empty" />

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

## Configuration

```toml title="pun.toml"
[analyse.rules]
"statements/invalid-empty" = "on"
```

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

## Replaces

- [`EmptyRule`](https://phpstan.org/error-identifiers/empty.expr) (phpstan-classes)
- [`checkAdvancedIsset`](https://phpstan.org/config-reference) (phpstan-parameters)
- [`RedundantIssetCheck`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`empty.initializedProperty`](https://phpstan.org/error-identifiers/empty.initializedProperty) (phpstan)
- [`empty.offset`](https://phpstan.org/error-identifiers/empty.offset) (phpstan)
- [`empty.property`](https://phpstan.org/error-identifiers/empty.property) (phpstan)
- [`empty.variable`](https://phpstan.org/error-identifiers/empty.variable) (phpstan)
- [`isset.initializedProperty`](https://phpstan.org/error-identifiers/isset.initializedProperty) (phpstan)
- [`isset.offset`](https://phpstan.org/error-identifiers/isset.offset) (phpstan)
- [`isset.property`](https://phpstan.org/error-identifiers/isset.property) (phpstan)
- [`isset.variable`](https://phpstan.org/error-identifiers/isset.variable) (phpstan)
- [`nullCoalesce.initializedProperty`](https://phpstan.org/error-identifiers/nullCoalesce.initializedProperty) (phpstan)
- [`nullCoalesce.offset`](https://phpstan.org/error-identifiers/nullCoalesce.offset) (phpstan)
- [`nullCoalesce.property`](https://phpstan.org/error-identifiers/nullCoalesce.property) (phpstan)
- [`nullCoalesce.variable`](https://phpstan.org/error-identifiers/nullCoalesce.variable) (phpstan)

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