projektmotor/symfony-coding-standard 问题修复 & 功能扩展

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

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

projektmotor/symfony-coding-standard

Composer 安装命令:

composer require projektmotor/symfony-coding-standard

包简介

Internal PHP coding standard of ProjektMOTOR

README 文档

README

Symfony coding standards for ProjektMOTOR enriched by several useful rules.

We at ProjektMOTOR ❤️ clean code. So we have a have an internal PHP coding standard based on symfony coding standard used for all our projects. We are using PHP CodeSniffer with the great Symfony PHP CodeSniffer Coding Standard of djoos and some sniffs of Slevomat Coding Standard, both adopted to our own needs.

Goals of our coding standard

  • Using already existing standards (PSR-1, PSR-2, Symfony).
  • Coding standard can be used across different projects.
  • Avoid duplications (also between code, CVS history and documentation).
  • Ensure code quality across different dev setups (e.g. different IDEs).

Installation

If you use Composer, you can install ProjektMOTOR Coding Standard in your project with the following command:

composer require --dev projektmotor/symfony-coding-standard

Optional: To install coding standard automatically edit your composer script:

    scripts: {
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ],
        "auto-scripts": {
            "phpcs --config-set installed_paths vendor/projektmotor/symfony-coding-standard/ProjektMOTORCodingStandard/": "script",
        }
    }

Usage

Just create a phpcs.xml.dist in your project's root directory with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="projektmotor-coding-standard">
    <rule ref="vendor/projektmotor/symfony-coding-standard/ProjektMOTORCodingStandard/ruleset.xml">
        <!-- If the standard is too hard, you can exclude some rules like this: -->
        <!-- <exclude name="Generic.Arrays.DisallowLongArraySyntax.Found" /> -->
        <!-- <exclude name="Generic.Files.LineLength.TooLong" /> -->
    </rule>
    
    <!-- Exclude project specific files if you want -->
    <!-- <exclude-pattern>WakkaFormatter</exclude-pattern> -->
</ruleset>

And then you can execute the CodeSniffer like this:

vendor/bin/phpcs -s -p --colors src/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固