You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `init` command creates a minimal .phpantom.toml with just a JSON
schema directive, but the documentation promised "all options documented
and commented out." This corrects that mismatch and brings the config
documentation up to date.
- Update DEFAULT_CONFIG_CONTENT to include helpful comments pointing
users to the schema and configuration reference, rather than leaving
a bare schema line.
- Rewrite the CLI.md init section to accurately describe the minimal
file that gets created and explain the schema-driven discoverability
approach.
- Rewrite the SETUP.md Project Configuration section with complete
reference tables for every config section: php, diagnostics (including
ignore rules), indexing, formatting, phpstan, phpcs, mago, and laravel
(schema and migrations). The previous version only covered php,
diagnostics (partially), indexing, and formatting.
- Add formatting.pint to config-schema.json, which was present in the
Rust config struct but missing from the schema.
- Add a PR template with a contributor checklist (inspired by jj-vcs)
to remind contributors to update docs, schema, changelog, and tests.
- Update README.md documentation link to mention configuration.
Closes#275
Copy file name to clipboardExpand all lines: config-schema.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,10 @@
135
135
"type": "object",
136
136
"description": "Controls the formatting strategy. PHPantom ships a built-in formatter (PER-CS 2.0 style). Projects with php-cs-fixer or PHP_CodeSniffer in composer.json require-dev automatically use those tools instead. Explicit configuration here always takes priority.",
137
137
"properties": {
138
+
"pint": {
139
+
"type": "string",
140
+
"description": "Command or path to run Laravel Pint. Unset: auto-detect from composer.json require-dev. Empty string: disable Pint. Any other value: use as the command."
141
+
},
138
142
"php-cs-fixer": {
139
143
"type": "string",
140
144
"description": "Command or path to run php-cs-fixer. Unset: auto-detect from composer.json require-dev. Empty string: disable php-cs-fixer. Any other value: use as the command."
|`unresolved-member-access`| bool |`false`| Report `->`, `?->`, `::` on subjects whose type could not be resolved. Useful for type coverage, noisy on untyped codebases. |
296
+
|`extra-arguments`| bool |`false`| Report calls that pass more arguments than the function accepts. |
297
+
|`report-magic-properties`| bool |`false`| Report unknown property access on classes with `__get` when virtual properties are defined. Matches PHPStan's `reportMagicProperties`. |
298
+
|`workspace`| bool |`true`| Compute diagnostics for the whole workspace in the background after startup. Requires the default `full` indexing strategy. |
299
+
|`workspace-external`| bool |`true`| Run configured external tools (PHPStan, PHPCS, Mago) once over the whole project after workspace diagnostics finish. |
300
+
301
+
##### `[[diagnostics.ignore]]`
302
+
303
+
Rules that suppress matching diagnostics, similar to PHPStan's
304
+
`ignoreErrors`. Each rule may constrain by `message` (regex), `path`
305
+
(glob relative to workspace root), and/or `identifier` (diagnostic
306
+
code). A diagnostic is suppressed when it matches every constraint
307
+
present on a rule; omitted constraints match anything.
275
308
276
309
```toml
277
-
[php]
278
-
# Override the detected PHP version (default: inferred from composer.json, or 8.5).
279
-
# version = "8.5"
280
-
281
-
[diagnostics]
282
-
# Report member access on subjects whose type could not be resolved.
283
-
# Useful for discovering gaps in type coverage. Off by default.
284
-
# unresolved-member-access = true
285
-
286
-
[indexing]
287
-
# How PHPantom discovers classes across the workspace.
288
-
# "full" (default) - scan PHP files and background-parse user files
289
-
# "composer" - use Composer classmap, self-scan on fallback
# "none" - no proactive scanning, Composer classmap only
292
-
# strategy = "full"
293
-
294
-
[formatting]
295
-
# Explicit path to an external formatter: always use this tool and skip
296
-
# require-dev auto-detection. Set to "" to disable that tool entirely.
297
-
# pint = "/usr/local/bin/pint"
298
-
# php-cs-fixer = "/usr/local/bin/php-cs-fixer"
299
-
# phpcbf = "/usr/local/bin/phpcbf"
300
-
301
-
# Timeout for external formatters, in milliseconds (default: 10000).
302
-
# timeout = 10000
310
+
[[diagnostics.ignore]]
311
+
path = "tests/**"
312
+
313
+
[[diagnostics.ignore]]
314
+
identifier = "deprecated_usage"
315
+
message = "^Call to deprecated function some_legacy_helper\\(\\)"
303
316
```
304
317
305
-
The file is optional. When absent, all settings use their defaults. New settings will be added as features land. Unknown keys are silently ignored, so the file is forward-compatible.
318
+
#### `[indexing]`
319
+
320
+
| Key | Type | Default | Description |
321
+
| ---------- | ------ | -------- | ----------- |
322
+
|`strategy`| string |`"full"`| Class discovery strategy: `"full"`, `"composer"`, `"self"`, or `"none"`. See [Indexing Strategy](#indexing-strategy) below. |
0 commit comments