tldr/pages/common/phpstan.md

29 lines
793 B
Markdown
Raw Normal View History

2018-02-28 21:43:29 +00:00
# phpstan
> A PHP static analysis tool to discover bugs in code.
2019-05-29 14:53:50 +01:00
> More information: <https://github.com/phpstan/phpstan>.
2018-02-28 21:43:29 +00:00
- Display available options for analysis:
`phpstan analyse --help`
2022-06-27 11:23:12 +01:00
- Analyze the specified space-separated directories:
2018-02-28 21:43:29 +00:00
`phpstan analyse {{path/to/directory}}`
2022-06-27 11:23:12 +01:00
- Analyze a directory using a configuration file:
2018-02-28 21:43:29 +00:00
`phpstan analyse {{path/to/directory}} --configuration {{path/to/config}}`
2022-06-27 11:23:12 +01:00
- Analyze using a specific rule level (0-7, higher is stricter):
2018-02-28 21:43:29 +00:00
`phpstan analyse {{path/to/directory}} --level {{level}}`
2022-06-27 11:23:12 +01:00
- Specify an autoload file to load before analyzing:
2018-02-28 21:43:29 +00:00
`phpstan analyse {{path/to/directory}} --autoload-file {{path/to/autoload_file}}`
- Specify a memory limit during analysis:
`phpstan analyse {{path/to/directory}} --memory-limit {{memory_limit}}`