Skip to content

Commit d71b907

Browse files
committed
Update CLAUDE.md about error identifiers docs
1 parent 805085e commit d71b907

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

website/errors/CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Each file follows this exact structure:
1919
```markdown
2020
---
2121
title: "<identifier>"
22+
shortDescription: "One sentence describing when this error is reported."
2223
ignorable: true
2324
---
2425

@@ -42,6 +43,7 @@ Ways to fix the error.
4243
### Frontmatter
4344
4445
- `title`: The error identifier (e.g., `"property.notFound"`)
46+
- `shortDescription`: One sentence (ending with a period) describing when the error is reported. Written from a user's perspective — what code pattern causes PHPStan to report this error. Examples: `"Accessing a private property from outside the declaring class."`, `"Loose comparison using == will always evaluate to true."`, `"Pure function uses print, which produces output as a side effect."`
4547
- `ignorable`: `true` for most identifiers. Set to `false` for identifiers that use `->nonIgnorable()` in the rule builder chain, or that start with `phpstan.` or `phpstanPlayground.`
4648

4749
### Code example
@@ -142,6 +144,7 @@ For `website/errors/deadCode.unreachable.md`:
142144
```markdown
143145
---
144146
title: "deadCode.unreachable"
147+
shortDescription: "Code after a return, throw, or other terminating statement can never be executed."
145148
ignorable: true
146149
---
147150

0 commit comments

Comments
 (0)