定制 edmondscommerce/phpqa 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

edmondscommerce/phpqa

Composer 安装命令:

composer create-project edmondscommerce/phpqa

包简介

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

README 文档

README

By Edmonds Commerce

Version 4 Updates

Brings in PHPStan 0.12 which is great

However you will need to do the following:

Remove PHPStan symlinks before upgrading

rm -f bin/phpstan*

Ensuring Correct PHPStan Configs

If you are overriding phpstan.neon in your qaConfig folder, then you need to make sure you have this in there:

parameters:
    level: max
    inferPrivatePropertyTypeFromConstructor: true

Version 3 Updates

You should update your phpunit.xml file to use printerClass="\PHPUnit\Util\TestDox\CliTestDoxPrinter"

see ./phpunit.xml

Introduction

PHPQA is a quality assurance pipeline written in BASH that can be run both on the desktop as part of your development process and then also as part of a continuous integration (CI) pipeline.

It runs tools in a logical order and will fail as quickly as possible.

PHPQA has only been tested on Linux.

Codacy Badge Build Status Code Coverage

Installing

You can follow dev-master which should generally be pretty stable (all features are developed in feature branches and must pass CI before making it into master. Alternatively if you want real stability, you can track a release version of your choice.

composer require edmondscommerce/phpqa:dev-master@dev --dev

Your project's composer.json needs to specify a bin folder. If it's not already present, add this:

    ...
    "config": {
        "bin-dir": "bin"
    }
    ...

Running

To run the full pipline, simply execute in your BASH terminal:

./bin/qa 

Usage:

$ ./bin/qa -h

Usage:
bin/qa [-t tool to run ] [ -p path to scan ]

Defaults to using all tools and scanning whole project based on platform

 - use -h to see this help

 - use -p to specify a specific path to scan

 - use -t to specify a single tool:
     psr|psr4         psr4 validation
     com|composer     composer validation
     st|stricttypes   strict types validation
     lint|phplint     phplint
     stan|phpstan     phpstan
     unit|phpunit     phpunit
     infect|infection infection
     md|messdetector  php mess detector
     ma|markdown      markdown validation
     bf|phpbf         php beautifier and fixer
     cs|phpcs         php code sniffer
     l|loc            lines of code and other stats


By default, PHPQA will run against the entire project root.

Single Tool:

If you want to run a single tool, use the -t option. See the usage above to get the shortcuts for the tools

./bin/qa -t stan

Specified Path:

Some of the tools allow us to restrict the scan to a specified path. To specify the path, use the -p option.

./bin/qa -p ./src/specified/path.php

Combined

You can combine both options

./bin/qa -t stan -p ./src/specified/path.php

Configuration

Please see the Configuration docs

The Pipeline

Please see the Pipeline docs

The QA Tools

For full details and configuration instructions for all fo the tools, please see the PHPQA Tools

Platform Detection

PHPQA comes with a set of generic tools and configs, but also has some inbuilt profiles.

Information on how this works can be found on the platform detection page

Specific platforms' docs are at:

Using for Continuous Integration (CI)

Please see the CI docs

Git Hooks

Have a look in gitHooks for git hooks that can be used in your project

The suggested way to use these is to symlink. Note that your actual git hook should not include the .bash file extension

To use the pre-commit hook, for example, you would do:

#cd to project root
cd /var/www/project/root

#cd to hooks folder
cd .git/hooks/

#create relative symlink
ln -s ../../vendor/edmondscommerce/phpqa/gitHooks/pre-commit.bash pre-commit

Then ensure the hook is executable by running it:

#cd to project root
cd /var/www/project/root

./git/hooks/pre-commit

And you should then see

===========================================
PHPQA Pre Commit Hook
===========================================

edmondscommerce/phpqa 适用场景与选型建议

edmondscommerce/phpqa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22.76k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2018 年 02 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 edmondscommerce/phpqa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 edmondscommerce/phpqa 我们能提供哪些服务?
定制开发 / 二次开发

基于 edmondscommerce/phpqa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 22.76k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 22
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-01