HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

phpstan — A PHP static analysis tool to discover bugs in code. More information: <https://phpstan.org/user-gui

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandstaticphpstananalysiscliphptooldiscover

Problem

How to use the phpstan command: A PHP static analysis tool to discover bugs in code. More information: <https://phpstan.org/user-guide/command-line-usage>.

Solution

phpstan — A PHP static analysis tool to discover bugs in code. More information: <https://phpstan.org/user-guide/command-line-usage>.

Analyze one or more directories:
phpstan analyse {{path/to/directory1 path/to/directory2 ...}}


Analyze a directory using a configuration file:
phpstan analyse {{path/to/directory}} {{[-c|--configuration]}} {{path/to/config}}


Analyze using a specific rule level (0-10, higher is stricter):
phpstan analyse {{path/to/directory}} {{[-l|--level]}} {{level}}


Specify an autoload file to load before analyzing:
phpstan analyse {{path/to/directory}} {{[-a|--autoload-file]}} {{path/to/autoload_file}}


Specify a memory limit during analysis:
phpstan analyse {{path/to/directory}} --memory-limit {{memory_limit}}


Display available options for analysis:
phpstan analyse --help

Code Snippets

Analyze one or more directories

phpstan analyse {{path/to/directory1 path/to/directory2 ...}}

Analyze a directory using a configuration file

phpstan analyse {{path/to/directory}} {{[-c|--configuration]}} {{path/to/config}}

Analyze using a specific rule level (0-10, higher is stricter)

phpstan analyse {{path/to/directory}} {{[-l|--level]}} {{level}}

Specify an autoload file to load before analyzing

phpstan analyse {{path/to/directory}} {{[-a|--autoload-file]}} {{path/to/autoload_file}}

Specify a memory limit during analysis

phpstan analyse {{path/to/directory}} --memory-limit {{memory_limit}}

Context

tldr-pages: common/phpstan

Revisions (0)

No revisions yet.