---
title: "lint/style/add-param-type-from-phpdoc"
pagination: false
---

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

<RuleId id="lint/style/add-param-type-from-phpdoc" />

Not in any set. Unsafe fix: it can change behaviour.

## What it does

Takes `@param` annotations of non-mixed types and adjusts accordingly the function signature.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/add-param-type-from-phpdoc" = "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.

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `scalar-types` | `bool` | Any | `true` | `scalar_types` |
| `types-map` | `map` | Any | `{  }` | `types_map` |
| `union-types` | `bool` | Any | `true` | `union_types` |

## Replaces

- [`phpdoc_to_param_type`](https://cs.symfony.com/doc/rules/function_notation/phpdoc_to_param_type.html) (php-cs-fixer, risky)

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