schwarzer/php-code-style 问题修复 & 功能扩展

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

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

schwarzer/php-code-style

最新稳定版本:v3.0.0

Composer 安装命令:

composer require schwarzer/php-code-style

包简介

Schwarzer IT's shared PHP style rules for PHP-CS-Fixer

README 文档

README

Require this package.

composer require "schwarzer/php-code-style" --dev

Using this package

Create a PHP-CS-Fixer dist file.

touch .php-cs-fixer.dist.php

Minimum Setup

Add this to your .php-cs-fixer.dist.php file.

<?php

$classLoader = require __DIR__ . '/vendor/autoload.php';
$classLoader->register(true);

$rules = [
    // 'use-this-to-override' => 'the-default-rules',
];

$finder = PhpCsFixer\Finder::create()
    ->in([
        __DIR__.'/your/source/code',
    ]);

return (new Schwarzer\PhpCs\Styles)($finder, $rules);

Our Laravel Setup

<?php

$classLoader = require __DIR__ . '/vendor/autoload.php';
$classLoader->register(true);

$rules = [
    // 'use-this-to-override' => 'the-default-rules',
];

$finder = PhpCsFixer\Finder::create()
    ->notPath('bootstrap')
    ->notPath('storage')
    ->notPath('vendor')
    ->in(getcwd())
    ->name('*.php')
    ->notName('*.blade.php')
    ->notName('index.php')
    ->notName('server.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return (new Schwarzer\PhpCs\Styles)($finder, $rules);

Ready

You can now use php-cs-fixer as usual.

  • php-cs-fixer fix --dry-run
  • php-cs-fixer fix

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固