21 Star 49 Fork 0

Gitee 极速下载/joomla

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/joomla/joomla-cms
克隆/下载
.php-cs-fixer.dist.php 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
Allon Moritz 提交于 2023-08-23 12:06 . Alpha order imports (#41428)
<?php
/**
* @package Joomla.Site
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* This is the configuration file for php-cs-fixer
*
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer
* @see https://mlocati.github.io/php-cs-fixer-configurator/#version:3.0
*
*
* If you would like to run the automated clean up, then open a command line and type one of the commands below
*
* To run a quick dry run to see the files that would be modified:
*
* ./libraries/vendor/bin/php-cs-fixer fix --dry-run
*
* To run a full check, with automated fixing of each problem :
*
* ./libraries/vendor/bin/php-cs-fixer fix
*
* You can run the clean up on a single file if you need to, this is faster
*
* ./libraries/vendor/bin/php-cs-fixer fix --dry-run administrator/index.php
* ./libraries/vendor/bin/php-cs-fixer fix administrator/index.php
*/
// Add all the core Joomla folders
$finder = PhpCsFixer\Finder::create()
->in(
[
__DIR__ . '/administrator',
__DIR__ . '/api',
__DIR__ . '/build',
__DIR__ . '/cache',
__DIR__ . '/cli',
__DIR__ . '/components',
__DIR__ . '/includes',
__DIR__ . '/installation',
__DIR__ . '/language',
__DIR__ . '/libraries/src',
__DIR__ . '/modules',
__DIR__ . '/plugins',
__DIR__ . '/templates',
__DIR__ . '/tests',
]
)
// Ignore template files as PHP CS fixer can't handle them properly
// https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/3702#issuecomment-396717120
->notPath('/tmpl/')
->notPath('/layouts/')
->notPath('/cassiopeia/')
->notPath('/atum/')
// Ignore psr12 scripts because they contain invalid syntax
->notPath('/psr12/')
->notName('github_rebase.php');
$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setHideProgress(false)
->setUsingCache(false)
->setRules(
[
// Basic ruleset is PSR 12
'@PSR12' => true,
// Short array syntax
'array_syntax' => ['syntax' => 'short'],
// Lists should not have a trailing comma like list($foo, $bar,) = ...
'no_trailing_comma_in_list_call' => true,
// Arrays on multiline should have a trailing comma
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
// Align elements in multiline array and variable declarations on new lines below each other
'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']],
// The "No break" comment in switch statements
'no_break_comment' => ['comment_text' => 'No break'],
// Remove unused imports
'no_unused_imports' => true,
// Classes from the global namespace should not be imported
'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
// Alpha order imports
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
]
)
->setFinder($finder);
return $config;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mirrors/joomla.git
git@gitee.com:mirrors/joomla.git
mirrors
joomla
joomla
4.4-dev

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385