---
title: "lint/phpunit/add-property-type-setup-docblock"
pagination: false
---

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

<RuleId id="lint/phpunit/add-property-type-setup-docblock" />

In the [`types`](/docs/rules/sets/types) set. Unsafe fix: it can change behaviour. Runs when phpunit is installed.

## What it does

Add property type in PHPUnit test from docblock, if defined in setUp() method

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/add-property-type-setup-docblock" = "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

- [`TypedPropertyFromDocblockSetUpDefined`](https://getrector.com/rule-detail/typed-property-from-docblock-set-up-defined-rector) (rector)

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