Files
tldr/pages.zh/common/phpmd.md

32 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# phpmd
> PHP 混乱检测器:检查常见潜在问题。
> 更多信息:<https://github.com/phpmd/phpmd>。
- 显示可用规则集和格式的列表:
`phpmd`
- 使用逗号分隔的规则集扫描文件或目录中的问题:
`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{ruleset1,ruleset2,...}}`
- 指定规则的最低优先级阈值:
`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{ruleset1,ruleset2,...}} --minimumpriority {{priority}}`
- 在分析中仅包含指定的扩展名:
`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{ruleset1,ruleset2,...}} --suffixes {{extensions}}`
- 排除指定的逗号分隔目录:
`phpmd {{path/to/file_or_directory1,path/to/file_or_directory2,...}} {{xml|text|html}} {{ruleset1,ruleset2,...}} --exclude {{directory_patterns}}`
- 将结果输出到文件而不是 `stdout`
`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{ruleset1,ruleset2,...}} --reportfile {{path/to/report_file}}`
- 忽略使用警告抑制的 PHPDoc 注释:
`phpmd {{path/to/file_or_directory}} {{xml|text|html}} {{ruleset1,ruleset2,...}} --strict`