glen/php-cs-fixer-config

提供 php-cs-fixer 的配置

0.3.0 2020-04-26 08:36 UTC

This package is auto-updated.

Last update: 2024-08-26 18:17:05 UTC


README

friendsofphp/php-cs-fixer 提供默认配置和配置构建器。

执行以下操作

PHP 版本由以下方式确定

  • composer.lock 读取(如果文件存在)
    "platform-overrides": {
        "php": "5.6.0"
    }
  • composer.json: 读取
    "config": {
        "platform": {
          "php": "5.6.0"
        }
    }

安装

运行

$ composer require --dev glen/php-cs-fixer-config

用法

配置

在项目的根目录中创建配置文件 .php_cs

<?php
// vim:ft=php

/** @var \glen\PhpCsFixerConfig\Config $config */
$config = require __DIR__ . '/vendor/glen/php-cs-fixer-config/phpcs.php';

$rules = $config->getRuleBuilder();
$rules['indentation_type'] = false;
$rules['class_definition'] = false;

return $config;

许可证

本软件包使用 MIT 许可证授权。

致谢

本项目 README 受 localheinz/php-cs-fixer-config 启发。