---
title: "lint/phpunit/add-will-return-callback-false-fallback"
pagination: false
---

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

<RuleId id="lint/phpunit/add-will-return-callback-false-fallback" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Unsafe fix: it can change behaviour. Runs when phpunit is installed. **Planned: not in Pun yet.** Enabling it is a config error.

## What it does

Add a "return false" fallback to a willReturnCallback() closure that only returns booleans, but can fall through without a return

## Replaces

- [`WillReturnCallbackFallbackToReturnFalse`](https://getrector.com/rule-detail/will-return-callback-fallback-to-return-false-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)
