Continuous integration/PHP CodeSniffer/zh

PHP CodeSniffer是一个用于检测PHP代码中的代码样式错误的实用程序. 我们使用Composer作为包装器来管理CodeSniffer的版本、依赖项和执行.

首先，通过运行 获取开发依赖项.

对于大多数MediaWiki扩展、皮肤和PHP库，执行 也将执行CodeSniffer. 由于MediaWiki核心的大小，它被公开为一个单独的命令.



在没有Composer的情况下本地执行
如果你遇到Composer超时的问题，你可以用 直接运行它. 重要的是要执行Composer在本地项目资源库的vendor/bin中安装的PHP_CodeSniffer版本，以便找到所有嗅探. Don't use the system version found on your PATH.

If you get out of memory errors, you can run it with more memory: .

Versioning
It is recommended that you pin a specific version in your  file. We try to adhere to the spirit of semver.org, but not the actual standard. The main thing we are concerned about is ensuring that no matter what, if when you run, it will pass if it previously passed, and not randomly fail because a new version was released. The build randomly failing is a pain when you're trying to backport a patch or just trying to develop something and need to interrupt your work to fix it.

We are currently using 0 as our major version, and will bump the minor version for new sniffs, and bump the patch version for bug fixes or enhancements to existing sniffs. No stability is guaranteed for the actual PHP code included.