---
title: "lint/laravel/prefer-report-if"
pagination: false
---

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

<RuleId id="lint/laravel/prefer-report-if" />

Not in any preset. In Rector's [`rector-laravel/laravel-if-helpers`](/docs/rules/sets/rector-laravel/laravel-if-helpers) set. Needs the [`laravel` extension](/docs/configuration/pun-toml#extensions). Unsafe fix: it can change behavior.

## What it does

Change if report to report_if

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/prefer-report-if" = "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

- [`ReportIf`](https://getrector.com/rule-detail/report-if-rector) (rector-laravel)

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