jmolivas/phpqa
Composer 安装命令:
composer create-project jmolivas/phpqa
包简介
PHP QA Analyzer
关键字:
README 文档
README
PHPQA Analyzer CLI tool
Overview
This project aims to serve as a CLI tool to make easy the use of different PHP tools related to Quality Assurance and code analysis in PHP.
Every analyzer tool handles arguments and options using different formats, the goal of this project is to provide a single way to interact with those projects, you can also set options and arguments using a default configuration file when the project supports it.
This project was originally developed as part of Drupal Console and based on the blog post Write your git hooks in PHP and keep them under git control.
Available Analyzers
-
This tool check syntax of PHP files faster then serial check with fancier output.
-
The PHP Coding Standards Fixer tool fixes most issues in your code when you want to follow the PHP coding standards as defined in the PSR-1 and PSR-2 documents.
-
PHP_CodeSniffer is a set of two PHP scripts; the main
phpcsscript that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a secondphpcbfscript to automatically correct coding standard violations. -
It is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly and easy to configure frontend for the raw metrics measured by PHP Depend.
-
phplocis a tool for quickly measuring the size and analyzing the structure of a PHP project. -
PHPDCD - PHP Dead Code Detector
phpdcdis a Dead Code Detector (DCD) for PHP code. It scans a PHP project for all declared functions and methods and reports those as being "dead code" that are not called at least once. -
PHPCPD - PHP Copy/Paste Detector
phpcpdis a Copy/Paste Detector (CPD) for PHP code. -
PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
Install
Cloning the project
$ git clone git@github.com:jmolivas/phpqa.git
$ cd phpqa
# download dependencies
$ composer install
# make phpqa globally accessible creating a symlink
$ ln -s /path/to/phpqa/bin/phpqa /usr/local/bin/phpqa
Usage
Copy configuration file(s)
$ cd to/project/path
$ phpqa init --project=PROJECT --override
$ phpqa init --global --override
| Option | Description |
|---|---|
| project | Available values php, symfony and drupal. |
| global | Copy configuration files to user home directory, instead of current working directory. |
| override | If this option is set, files are copied using override flag. |
NOTES:
- Option
globaldoes not accept a value must be set as--global. - Option
overridedoes not accept a value must be set as--override. - Options
projectandglobalcan not used in combination.
Analyze a project
$ cd to/project/path
$ phpqa analyze --project=PROJECT --files=FILES
$ phpqa analyze --project=PROJECT --git
| Option | Description |
|---|---|
| project | Available values php, symfony and drupal |
| files | Files or directories to analyze. |
| git | If this option is set, all files added to git index will be scanned. This is useful when setting executing this tool on a pre-commit git-hook. |
NOTES:
- Option
gitdoes not accept a value must be set as--git. - Option
projectcould be omitted if aphpqa.ymlorphpqa.yml.distfile is available at current working directory. - Options
filesandgitcan not used in combination.
Override configuration
This project was built to be fully customizable, you can enable/disable analyzers and modify arguments/options passed to analyzers by updating the phpqa.yml or phpqa.yml.dist file on your project root copied when running init command, or the files ~/.phpqa/php/config.yml, ~/.phpqa/symfony/config.yml or ~/.phpqa/drupal/config.yml copied when running init command using --global option.
Nice to have features
- Add command to create new project.
- Add more analyzers:
- Add analyzer via config and not as composer dependency.
- Detect if analyzer is already loaded on the local machine and use that instead of download.
- Add custom analyzers.
- Add SaaS analyzers via API.
This project is a work-in-progress and needs some love related to code clean up, test coverage and documentation.
jmolivas/phpqa 适用场景与选型建议
jmolivas/phpqa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 266 次下载、GitHub Stars 达 325, 最近一次更新时间为 2015 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「development」 「qa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jmolivas/phpqa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jmolivas/phpqa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jmolivas/phpqa 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Library with classes to help you do batch.
GHT D-Tools Bundle
nabu-3 SDK package to extend Framework with extensions for developers
Use a translation namespace vor mutliple translation files.
The query builder for WordPress
统计信息
- 总下载量: 266
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 325
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-17