Skip to main content

Configuration File

Prune reads its settings from a NEON file in your project root. A config file lets you commit your scan setup so every run — local or CI — behaves the same without long command lines.

File resolution

When you don't pass --config, Prune looks for these files in order and uses the first one it finds:

  1. prune.neon
  2. prune.neon.dist

If neither exists, Prune runs with built-in defaults. Point at any other file explicitly with --config:

php vendor/bin/prune src --config=custom-prune.neon

A common convention is to commit prune.neon.dist as the shared baseline and let developers override locally with an un-committed prune.neon.

Full example

parameters:
paths:
- src
- app
excludePaths:
- vendor
- tests
extensions:
- php
format: console
blade:
enabled: true
viewPaths:
- resources/views
referencePaths:
- routes
excludeViews:
- errors.404
- errors.500

All settings live under the top-level parameters key.

Options

Top-level

OptionTypeDefaultDescription
pathslist of string[src]Directories to scan for class declarations.
excludePathslist of string[vendor]Paths excluded from scanning.
extensionslist of string[php]File extensions to include.
formatstringconsoleOutput format: console, json, or html.

blade

OptionTypeDefaultDescription
blade.enabledbooltrueEnable Blade view orphan detection.
blade.viewPathslist of string[resources/views]Directories containing Blade templates.
blade.referencePathslist of string[routes]Extra PHP paths scanned for view() / Route::view() calls.
blade.excludeViewslist of string[]View names (dot notation) to never report.

See Blade Analysis for a deeper explanation of the Blade options.

Validation

Prune validates the config when it loads it. If a value has the wrong type — for example paths is not a list of strings, or blade is not a map — Prune stops with a descriptive error naming the offending key and file. Missing keys simply fall back to their defaults.

Precedence

Command-line arguments and options override the config file:

  • The paths argument overrides paths from the config.
  • --format overrides format.
  • --blade forces Blade-only mode regardless of blade.enabled.

See the CLI Reference for the full precedence rules.