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

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

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

nextcloud/coding-standard

最新稳定版本:v1.4.0

Composer 安装命令:

composer require --dev nextcloud/coding-standard

包简介

Nextcloud coding standards for the php cs fixer

关键字:

README 文档

README

Nextcloud coding standards for the php cs fixer.

Installation

Add the package to your dev dependencies

composer require --dev nextcloud/coding-standard

and create a .php-cs-fixer.dist.php like

<?php

declare(strict_types=1);

require_once './vendor/autoload.php';

use Nextcloud\CodingStandard\Config;

$config = new Config();
$config
	->getFinder()
	->ignoreVCSIgnored(true)
	->notPath('build')
	->notPath('l10n')
	->notPath('src')
	->notPath('vendor')
	->in(__DIR__);
return $config;

To run the fixer you first have to install it. Then you can run php-cs-fixer fix to apply all automated fixes.

For convenience you may add it to the scripts section of your composer.json:

{
    "scripts": {
        "cs:check": "php-cs-fixer fix --dry-run --diff",
        "cs:fix": "php-cs-fixer fix"
    }
}

Note: Don't forget to exclude .php-cs-fixer.dist.php and .php-cs-fixer.cache in your build scripts.

Upgrade from v0.x to v1.0

With v1.0 php-cs-fixer was updated from v2 to v3. You'll have to adjust your app slightly:

  • Rename .php_cs.dist to .php-cs-fixer.dist.php
  • Add .php-cs-fixer.cache to your ignore files

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04