---
title: "lint/classes/no-protected-in-final"
pagination: false
---

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

<RuleId id="lint/classes/no-protected-in-final" />

In the [`privatization`](/docs/rules/sets/privatization) set. Safe fix.

## What it does

Converts `protected` variables and methods to `private` where possible.

## Configuration

```toml title="pun.toml"
[lint.rules]
"classes/no-protected-in-final" = "error"
```

To skip it in some files, add an [override](/docs/configuration/pun-toml#lint) or a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Replaces

- [`protected_to_private`](https://cs.symfony.com/doc/rules/class_notation/protected_to_private.html) (php-cs-fixer)
- [`no-protected-in-final`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-protected-in-final) (mago-linter)

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