---
title: "lint/phpdoc/no-void-on-magic-method"
pagination: false
---

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

<RuleId id="lint/phpdoc/no-void-on-magic-method" />

In the [`dead-code`](/docs/rules/sets/dead-code) set. Safe fix.

## What it does

Remove useless @return void docblock from magic methods __construct, __destruct, and __clone

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpdoc/no-void-on-magic-method" = "error"
```

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

## Replaces

- [`RemoveVoidDocblockFromMagicMethod`](https://getrector.com/rule-detail/remove-void-docblock-from-magic-method-rector) (rector)

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