承接 longman/php-code-style 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

longman/php-code-style

Composer 安装命令:

composer require longman/php-code-style

包简介

Longish Code style configurations

README 文档

README

This is a PSR-12 based code style ruleset for PHP Code Sniffer

PHP Code Sniffer

Configuration file: longish.phpcs.xml

Usage

  1. Link longman/php-code-style repo as composer dependency

    $ composer require --dev longman/php-code-style

  2. Extend provided configuration to adapt it to your project. For example, create custom phpcs.xml file and put:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Project code style checker config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd">
    <rule ref="./vendor/longman/php-code-style/longish.phpcs.xml"/>
    
    <!-- Exclude stubs file for PSR1.Classes.ClassDeclaration rule -->
    <rule ref="PSR1.Classes.ClassDeclaration">
        <exclude-pattern>*/_stubs.php</exclude-pattern>
    </rule>
    
    <!-- Exclude stubs file for Generic.CodeAnalysis.UnconditionalIfStatement rule -->
    <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement.Found">
        <exclude-pattern>*/_stubs.php</exclude-pattern>
    </rule>
</ruleset>
  1. For Laravel you can directly include laravel.phpcs.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Project code style checker config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd">
    <rule ref="./vendor/longman/php-code-style/laravel.phpcs.xml" />

</ruleset>

Running check (Laravel example):

vendor/bin/phpcs --standard=vendor/longman/php-code-style/laravel.phpcs.xml -spn --encoding=utf-8 --report-width=150 --colors --parallel=16 app/ config/ tests/

Running check with custom phpcs.xml:

vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 --report-width=150 --colors --parallel=16 app/ config/ tests/

统计信息

  • 总下载量: 22.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 7
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固