alanwillms/php-hound
Composer 安装命令:
composer require alanwillms/php-hound
包简介
Runs a set of quality assurance tools for PHP.
README 文档
README
This is a work in progress!
PHP Hound runs a set of quality assurance tools for PHP and reduce results to a single beautiful report.
It currently supports:
- PHPCodeSniffer: code style and identation according to PSR-2.
- PHPCopyPasteDetector: duplicated code detection.
- PHPMessDetector: checks for complex, unused, broken or unclear code.
Installation
PHP Hound can be installed through Composer.
Local installation
To install it locally, run the following command:
composer require alanwillms/php-hound
Then you can execute PHP Hound by running ./vendor/bin/php-hound.
Global installation
You can install PHP Hound globally with:
composer global require alanwillms/php-hound
Then you can add ~/.composer/bin directory to your PATH, so you can
simply type php-hound to run it from anywhere. If you want to do this,
add the following to your ~/.profile (or ~/.bashrc) file:
export PATH="$HOME/.composer/vendor/bin:$PATH"
If you want to apply the changes to your current terminal session, run
source ~/.profile (or source ~/bashrc).
Command line usage
Basic usage:
# Analyze current directory files php-hound # Analyze "informed/directory/" files php-hound informed/directory/ # Analyze "script.php" file php-hound script.php
You can run php-hound --help to display a list of all available options.
php-hound [optional arguments] [path to be analysed]
Optional Arguments:
-f format, --format format (default: text)
Output format
-h, --help
Prints a usage statement
-i ignore, --ignore ignore (default: vendor,tests,features,spec)
Ignore a comma-separated list of directories
-v, --version
Prints installed version
Gradually fix legacy code
If you have a huge base of legacy code, it's really hard to fix all code issues at the same time, in a single commit.
PHP Hound helps you to gradually fix your code by only warning about issues found in the files and lines touched by a branch or commit. All other files or lines will be ignored.
That's pretty easy to achieve:
# Usage: # php-hound --git-diff <commits or branches to compare> <target directory> # Only return issues found on lines and files changed on the "windows10" branch: php-hound --git-diff master..windows10 /path/to/git/repo # Only return issues found on lines and files changed between two commits php-hound --git-diff b28a1df..4fff883 /path/to/git/repo
alanwillms/php-hound 适用场景与选型建议
alanwillms/php-hound 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 303 次下载、GitHub Stars 达 10, 最近一次更新时间为 2015 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「quality」 「phpcs」 「qa」 「phpcpd」 「phpmd」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alanwillms/php-hound 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alanwillms/php-hound 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alanwillms/php-hound 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Copy/Paste Detector for PHP code
A simple tool for checking that your PHP classes and methods use PHPDocs (PHP DocBlocks Checker fork).
This is the ZooRoyal coding standard.
Taptima PHP-CS-Fixer fixers
Generic build- and deployment targets
Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !
统计信息
- 总下载量: 303
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-08-07
