定制 ecphp/php-conventions 二次开发

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

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

ecphp/php-conventions

Composer 安装命令:

composer require ecphp/php-conventions

包简介

ECPHP PHP conventions.

README 文档

README

Latest Stable Version GitHub stars Total Downloads License

ECPHP PHP conventions

Description

A developer tool which provides a pre-defined GrumPHP configuration tailored specifically for PHP development at European Commission.

This package has been inspired by drupol/php-conventions and ergebnis/php-library-template.

Features

Based on GrumPHP, this tool will run a set of quality control tools via a git hook. The user is free to disable the git hook and run the tool manually instead, see the documentation to know more about that.

The default GrumPHP configuration ships with the following checks:

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 needs.

Installation

composer require ecphp/php-conventions --dev

Add or edit the file grumphp.yml.dist or grumphp.yml and add on the top it:

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

Replace the string php73 with the minimal version of PHP you want to support.

Current choices are:

  • psr12
  • php73
  • php74 (Not available yet)

You may configure everything from that file.

To add an extra task or skip a task:

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

parameters:
  extra_tasks:
    phpunit: ~
  skip_tasks:
    - phpstan

To edit the configuration of a particular existing task

imports:
  - { resource: vendor/ecphp/php-conventions/config/php73/grumphp.yml }

parameters:
  tasks.license.holder: <License holder here>
  tasks.license.name: BSD-3-Clause # MIT and EUPL-1.2 are also available
  tasks.license.date_from: 2019

Find all the available customizable properties in the imported file on the top of the YAML file.

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_require_checker
    • composer
    • composer_normalize
    • yamllint
    • jsonlint
    • phplint
    • twigcs
    • phpcsfixer
    • phpcs
  • 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,phpcs

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.

ecphp/php-conventions 适用场景与选型建议

ecphp/php-conventions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.02k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-04-19