Linux command
phan 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Analyze PHP project
phan
Analyze specific directory
phan --directory [src/]
Generate baseline
phan --save-baseline [.phan/baseline.php]
Use baseline
phan --load-baseline [.phan/baseline.php]
Output format
phan --output-mode [json]
说明
phan is a PHP static analyzer. Finds bugs through type checking. The tool performs deep analysis. Supports PHP 7/8 features.
参数
- --directory _DIR_
- Directory to analyze.
- --config-file _FILE_
- Configuration file.
- --save-baseline _FILE_
- Save baseline.
- --load-baseline _FILE_
- Load baseline.
- --output-mode _FORMAT_
- Output format.
- --help
- Display help.
FAQ
What is the phan command used for?
phan is a PHP static analyzer. Finds bugs through type checking. The tool performs deep analysis. Supports PHP 7/8 features.
How do I run a basic phan example?
Run `phan` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --directory _DIR_ do in phan?
Directory to analyze.