Forrest logo
tool overview
On this page you find all important commands for the CLI tool phpstan. If the command you are looking for is missing please ask our AI.

phpstan

PHPStan scans your whole codebase and looks for both obvious & tricky bugs. Even in those rarely executed if statements that certainly aren't covered by tests.

List of commands for phpstan:

  • phpstan:analyze Analyze using a specific rule level (0-7, higher is stricter).
    $ phpstan analyse ${path/to/directory} --level ${level}
    try on your machine
    explain this command
  • phpstan:analyze:with-autoload Specify an autoload file to load before analyzing.
    $ phpstan analyse ${path/to/directory} --autoload-file ${path/to/autoload_file}
    try on your machine
    explain this command
  • phpstan:analyze:with-config Analyze a directory using a configuration file.
    $ phpstan analyse ${path/to/directory} --configuration ${path/to/config}
    try on your machine
    explain this command
  • phpstan:analyze:with-memory-limit Specify a memory limit during analysis.
    $ phpstan analyse ${path/to/directory} --memory-limit ${memory_limit}
    try on your machine
    explain this command
  • phpstan:options:display Display available options for analysis.
    $ phpstan analyse --help
    try on your machine
    explain this command
  • phpstan:tldr:97cce phpstan: Analyze the specified space-separated directories.
    $ phpstan analyse ${path-to-directory}
    try on your machine
    explain this command
tool overview