---
title: "lint/phpunit/no-any-matcher"
pagination: false
---

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

<RuleId id="lint/phpunit/no-any-matcher" />

Not in any set. Safe fix. Runs when phpunit is installed. **Planned: not in Pun yet.** Enabling it is a config error.

## What it does

Change deprecated `$this->any()` matcher assign to direct `new AnyInvokedCount()`

## Replaces

- [`AnyMatcherToNewAnyInvokedCount`](https://getrector.com/rule-detail/any-matcher-to-new-any-invoked-count-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)
