---
title: "lint/phpunit/add-mock-intersection-param"
pagination: false
---

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

<RuleId id="lint/phpunit/add-mock-intersection-param" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Safe fix. Runs when phpunit is installed.

## What it does

Add a MockObject intersection @param docblock with the mocked class, based on the mock passed in the private method call

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/add-mock-intersection-param" = "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

- [`AddIntersectionParamToMockObjectParam`](https://getrector.com/rule-detail/add-intersection-param-to-mock-object-param-rector) (rector-phpunit)

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