vancodx/php-coding-style 问题修复 & 功能扩展

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

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

vancodx/php-coding-style

最新稳定版本:1.3.0

Composer 安装命令:

composer require vancodx/php-coding-style

包简介

VanCodX PHP Coding Style

README 文档

README

Installation

Install this package with the following command:

composer require --dev vancodx/php-coding-style

Create ".php-cs-fixer.dist.php" file in the root directory of your project with the following contents:

<?php declare(strict_types=1);

use VanCodX\CodingStyle\PhpCsFixer\ConfigCreator;

$config = ConfigCreator::create();
$config->getFinder()->in(__DIR__);
return $config;

Create ".phpcs.xml.dist" file in the root directory of your project with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
         name="Custom Rule Set">

    <file>.</file>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <arg name="extensions" value="php"/>

    <rule ref="vendor/vancodx/php-coding-style/phpcs-ruleset"/>

</ruleset>

Add the following lines into "composer.json" file of your project:

{
  "scripts": {
    "test": [
      "php-cs-fixer fix",
      "phpcs -p"
    ]
  }
}

Add the following lines into your ".gitignore" file:

.php-cs-fixer.cache
.php-cs-fixer.php
.phpcs.xml

Usage

Use the following command:

composer test

统计信息

  • 总下载量: 49
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-08