定制 phlak/coding-standards 二次开发

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

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

phlak/coding-standards

最新稳定版本:4.0.0

Composer 安装命令:

composer require phlak/coding-standards

包简介

A pre-defined set of coding standards for PHP CS Fixer.

README 文档

README

Join our Community Become a Sponsor One-time Donation
Latest Stable Version Total Downloads License Test Suite

A pre-defined set of coding standards for PHP CS Fixer
Created by Chris Kankiewicz (@phlak.dev)

Requirements

  • PHP >= 8.1

Installation

composer require --dev phlak/coding-standards

Usage

After installation you may initialze the coding standards configuration with the provided cs executable.

composer exec cs init

Alternatively you may manually create a .php-cs-fxer.dist.php file in the root folder with the following contents.

<?php

require __DIR__ . '/vendor/autoload.php';

$finder = PhpCsFixer\Finder::create()->in([
    // List of paths you wish to include
]);

return PHLAK\CodingStandards\ConfigFactory::make($finder);

Add the paths you wish to be coverd to the array.

Now you may run php-cs-fixer as normal.

Add / Override Rules

You can add additional rules or override pre-defined ones by passing them as the second parameter to the ConfigFactory::make() method. These rules will be merged with the pre-defined rules.

return PHLAK\CodingStandards\ConfigFactory::make($finder, [
    // Your additional rules here...
]);

Additional Configuration

Additional configuration can be achieved by chaining methods onto the ConfigFactory::make() method.

return PHLAK\CodingStandards\ConfigFactory::make($finder)
    ->setIndent("\t")
    ->setLineEnding("\r\n")
    ->setRiskyAllowed();

Changelog

A list of changes can be found on the GitHub Releases page.

Troubleshooting

For general help and support join our GitHub Discussions or reach out on Bluesky.

Please report bugs to the GitHub Issue Tracker.

Copyright

This project is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固