nafigator/php-qa-hooks
Composer 安装命令:
composer require nafigator/php-qa-hooks
包简介
Git hooks for PHP commits QA.
README 文档
README
PHP QA git hooks
Git hooks for PHP commits quality assurance
Requirements
- git
- bash
- PHP CLI
- Core utils
Features
- Customization by git config options
- Check for PHP syntax before commit
- Check for Git conflict markups before commit
- Warn about PHP dump functions (var_dump(), var_export(), print_r())
- Check PHP code style before push
- Run PHPUnit tests before push
- Colored output
Install via Composer
-
Install package:
composer require --dev nafigator/php-qa-hooks -
Add extra section to composer.json:
"extra": { "scripts-dev": { "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-install.sh" } } -
Place phpcs.xml into root of your project.
NOTE: An example phpcs.xml file can be found in the PHP_CodeSniffer repository: phpcs.xml.dist
-
Run
composer install.
Uninstall
-
Remove git config section
check.phpgit config --remove-section check.php -
Add extra section to composer.json:
"extra": { "scripts-dev": { "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-uninstall.sh" } }Commit and push your changes to repository. When uninstall script completes cleanup for all work copies, move to next step.
-
Remove package:
composer remove --dev nafigator/php-qa-hooks -
Remove phpcs.xml from root ot your project.
Configuration
Example (colors off):
git config check.php.colors false
Available git config options:
check.php.colors [true|false]
check.php.conflicts [true|false]
check.php.dumps [true|false]
check.php.phpunit [true|false]
check.php.style [true|false]
check.php.syntax [true|false]
NOTE: PHPUnit disabled by default. You need to enable it manually.
Versioning
This software follows "Semantic Versioning" specifications. All function signatures declared as public API.
Read more on SemVer.org.
nafigator/php-qa-hooks 适用场景与选型建议
nafigator/php-qa-hooks 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 8.86k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「git」 「code-style」 「git-conflicts」 「git-hooks」 「bash-script」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nafigator/php-qa-hooks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nafigator/php-qa-hooks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nafigator/php-qa-hooks 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily manage git hooks in your composer config
Axa Zara PHP Code style configuration for `php-cs-fixer` based on PSR-12.
MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages
Nagios plugin to verify a git repository.
GitHub Webhook Listener with plugin-based API for creating your own triggerered actions
Shared PHP-CS-Fixer configuration with reusable rule sets for PHP 8.3+.
统计信息
- 总下载量: 8.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-06
