---
title: "lint/style/prefer-generic-array-phpdoc"
pagination: false
---

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

<RuleId id="lint/style/prefer-generic-array-phpdoc" />

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

## What it does

PHPDoc `array<T>` type must be used instead of `T[]`.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/prefer-generic-array-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.

## Replaces

- [`phpdoc_array_type`](https://cs.symfony.com/doc/rules/phpdoc/phpdoc_array_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)
