jasny/php-code-quality 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jasny/php-code-quality

最新稳定版本:v3.0.0

Composer 安装命令:

composer require jasny/php-code-quality

包简介

Quality assurance toolchain

README 文档

README

Coding standard

Adhere to the PSR-12 coding standard.

Installation

All PHP projects of Jasny should include this package. It can be installed through composer.

composer require --dev jasny/php-code-quality

Toolchain

PHPUnit

PHPUnit is a programmer-oriented testing framework for PHP. The unit tests should be in the tests directory.

Copy the PHPUnit configuration into the projects root folder

cp vendor/jasny/php-code-quality/phpunit.xml.dist .

vfsStream

vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system.

PHP CodeSniffer

phpcs tokenises PHP files and detects violations of a defined set of coding standards. It is an essential development tool that ensures your code remains clean and consistent.

This package comes with a custom ruleset which embodies the Jasny PHP coding standard, which should be copied to the project root folder.

cp vendor/jasny/php-code-quality/phpcs.xml.dist phpcs.xml

PHPStan

PHPStan is a static code analysis tool. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

Copy the PHPStan configuration to the project root folder

cp vendor/jasny/php-code-quality/phpstan.neon.dist phpstan.neon

Composer scripts

Composer can be configured to run all tests

"scripts": {
    "test": [
        "phpunit",
        "phpstan analyse",
        "phpcs -p src"
    ]
},
"scripts-descriptions": {
    "test": "Run all tests and quality checks"
}

To run all tests do

composer run-script test

Services

Open source projects should all of these quality assurance services. Closed source project may use a single service to both run tests and code quality checks in order to save costs.

GitHub actions

GitHub actions will run all unit tests on each pull-request and push to the master branch.

Copy the github folder from the php-code-quality directory.

cp -r vendor/jasny/php-code-quality/github .github

Scrutinizer

Scrutinizer tests code quality using PHP CodeSniffer, PHPStan and a custom analysis tool from Scrutinizer. It also collects tests coverage results.

jasny/php-code-quality 适用场景与选型建议

jasny/php-code-quality 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.14k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 jasny/php-code-quality 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 13.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 20
  • 依赖项目数: 40
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-17