drupol/php-conventions
Composer 安装命令:
composer require drupol/php-conventions
包简介
PHP conventions based on GrumPHP.
README 文档
README
PHP conventions
Description
A developer tool which provides a pre-defined GrumPHP configuration tailored specifically for PHP development.
Features
The default GrumPHP configuration ships with the following checks:
- License file creation,
- Composer Require Checker,
composer.jsonvalidation,- composer.json normalization,
- YAML Lint,
- JSON Lint,
- PHP Lint,
- Twig CS,
- PHP CS Fixer checks (Based on PSR12),
- PHP CS,
- PHPStan.
- PSalm,
It provides a default configuration for each task, and they are customizable at will through a simple YAML configuration file.
Tasks can be also added or skipped according to your need.
Installation
composer require drupol/php-conventions --dev
If you're not using GrumPHP
Manually add to your composer.json file
"extra": { "grumphp": { "config-default-path": "vendor/drupol/php-conventions/config/php73/grumphp.yml", }, }
Replace the string php73 with the minimal version of PHP you want to support.
Current choices are:
psr12
If you're using GrumPHP already
Edit the file grumphp.yml.dist or grumphp.yml and add on the top it:
imports: - { resource: vendor/drupol/php-conventions/config/php73/grumphp.yml }
To add an extra GrumPHP task:
imports: - { resource: vendor/drupol/php-conventions/config/php73/grumphp.yml } parameters: extra_tasks: infection: threads: 1 test_framework: phpspec configuration: infection.json.dist min_msi: 60 min_covered_msi: 60 skip_tasks: - phpcsfixer
In conjunction with extra_tasks, use skip_tasks to skip tasks if needed.
Usage
Basic usage
vendor/bin/grumphp run
This will run all the pre-configured tasks.
Advanced usage
If you're willing to specify a group of tasks only, you can use the pre-defined test suites.
Available test-suites are:
cs- license
- composer
- composer_normalize
- yamllint
- jsonlint
- phplint
- twigcs
- phpcsfixer
static-analysis- phpstan
- psalm
To run a particular test-suite:
vendor/bin/grumphp run --testsuite=cs
To run particular tasks:
vendor/bin/grumphp run --tasks=phpcsfixer,phpstan
Contributing
Report bug on the issue tracker.
See the file CONTRIBUTING.md but feel free to contribute to this library by sending Github pull requests.
Changelog
See CHANGELOG.md for a changelog based on git commits.
For more detailed changelogs, please check the release changelogs.
To generate the changelog, use the following command:
docker-compose run auto_changelog --commit-limit false --hide-credit --sort-commits date-desc --breaking-pattern ""BREAKING CHANGE: yes" --template keepachangelog -u
drupol/php-conventions 适用场景与选型建议
drupol/php-conventions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 132.57k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 drupol/php-conventions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drupol/php-conventions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 132.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 7
- 依赖项目数: 58
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-22