mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-07 12:38:11 +08:00
style: 为插件新增 .php-cs-fixer 配置
在多个插件目录(包括 plugin/think-library 及多个 think-plugs-*)新增 .php-cs-fixer.php 文件以统一 PHP 代码风格和头部注释。配置启用严格类型声明、并行运行、常用规则集(@PSR2/@Symfony/@PhpCsFixer 等)以及若干自定义规则,便于代码格式统一与自动修复;同时调整了 .copilot-commit-message-instructions.md 的换行样式。
This commit is contained in:
parent
d2b499d14a
commit
63523902db
@ -1,4 +1,5 @@
|
|||||||
请用中文生成提交信息,遵循规范提交格式:
|
请用中文生成提交信息,遵循规范提交格式:
|
||||||
|
|
||||||
- 标题:类型:以业务内容为主简短描述
|
- 标题:类型:以业务内容为主简短描述
|
||||||
- 正文:详细说明改动原因与内容
|
- 正文:详细说明改动原因与内容
|
||||||
- 类型:feat/fix/docs/style/refactor/test/chore
|
- 类型:feat/fix/docs/style/refactor/test/chore
|
||||||
120
plugin/think-library/.php-cs-fixer.php
Normal file
120
plugin/think-library/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-account/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-account/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-admin/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-admin/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-center/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-center/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-helper/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-helper/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-payment/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-payment/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-static/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-static/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-wechat-service/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-wechat-service/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-wechat/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-wechat/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-wemall/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-wemall/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-worker/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-worker/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
120
plugin/think-plugs-wuma/.php-cs-fixer.php
Normal file
120
plugin/think-plugs-wuma/.php-cs-fixer.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | Payment Plugin for ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 官方网站: https://thinkadmin.top
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | 开源协议 ( https://mit-license.org )
|
||||||
|
* | 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
* | 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
* | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
* | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
* +----------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
|
$header = <<<'EOF'
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| Payment Plugin for ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 官方网站: https://thinkadmin.top
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| 开源协议 ( https://mit-license.org )
|
||||||
|
| 免责声明 ( https://thinkadmin.top/disclaimer )
|
||||||
|
| 会员特权 ( https://thinkadmin.top/vip-introduce )
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
| gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
|
||||||
|
| github 代码仓库:https://github.com/zoujingli/ThinkAdmin
|
||||||
|
+----------------------------------------------------------------------
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config->setRiskyAllowed(true)->setParallelConfig(new ParallelConfig(8, 24));
|
||||||
|
$finder = Finder::create()->in(__DIR__)->exclude(['vendor', 'public', 'runtime']);
|
||||||
|
return $config->setFinder($finder)->setUsingCache(false)->setRules([
|
||||||
|
'@PSR2' => true,
|
||||||
|
'@Symfony' => true,
|
||||||
|
'@DoctrineAnnotation' => true,
|
||||||
|
'@PhpCsFixer' => true,
|
||||||
|
'header_comment' => [
|
||||||
|
'comment_type' => 'PHPDoc',
|
||||||
|
'header' => $header,
|
||||||
|
'separate' => 'none',
|
||||||
|
'location' => 'after_declare_strict',
|
||||||
|
],
|
||||||
|
'array_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'list_syntax' => [
|
||||||
|
'syntax' => 'short',
|
||||||
|
],
|
||||||
|
'blank_line_before_statement' => [
|
||||||
|
'statements' => [
|
||||||
|
'declare',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'general_phpdoc_annotation_remove' => [
|
||||||
|
'annotations' => [
|
||||||
|
'author',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'ordered_imports' => [
|
||||||
|
'imports_order' => [
|
||||||
|
'class', 'function', 'const',
|
||||||
|
],
|
||||||
|
'sort_algorithm' => 'alpha',
|
||||||
|
],
|
||||||
|
'single_line_comment_style' => [
|
||||||
|
'comment_types' => [
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'yoda_style' => [
|
||||||
|
'always_move_variable' => false,
|
||||||
|
'equal' => false,
|
||||||
|
'identical' => false,
|
||||||
|
],
|
||||||
|
'phpdoc_align' => [
|
||||||
|
'align' => 'left',
|
||||||
|
],
|
||||||
|
'multiline_whitespace_before_semicolons' => [
|
||||||
|
'strategy' => 'no_multi_line',
|
||||||
|
],
|
||||||
|
'constant_case' => [
|
||||||
|
'case' => 'lower',
|
||||||
|
],
|
||||||
|
'encoding' => true, // PHP代码必须只使用没有BOM的UTF-8
|
||||||
|
'line_ending' => true, // 所有的PHP文件编码必须一致
|
||||||
|
'single_quote' => true, // 简单字符串应该使用单引号代替双引号
|
||||||
|
'no_empty_statement' => true, // 不应该存在空的结构体
|
||||||
|
'standardize_not_equals' => true, // 使用 <> 代替 !=
|
||||||
|
'blank_line_after_namespace' => true, // 命名空间之后空一行
|
||||||
|
'no_empty_phpdoc' => true, // 不应该存在空的 phpdoc
|
||||||
|
'no_empty_comment' => true, // 不应该存在空注释
|
||||||
|
'no_singleline_whitespace_before_semicolons' => true, // 禁止在关闭分号前使用单行空格
|
||||||
|
'concat_space' => ['spacing' => 'one'], // 连接字符是否需要空格,可选配置项 none:不需要 one:一个空格
|
||||||
|
'no_leading_import_slash' => true, // use 语句中取消前置斜杠
|
||||||
|
'cast_spaces' => ['space' => 'none'],
|
||||||
|
'class_attributes_separation' => true,
|
||||||
|
'combine_consecutive_unsets' => true,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
'lowercase_static_reference' => true,
|
||||||
|
'linebreak_after_opening_tag' => true,
|
||||||
|
'multiline_comment_opening_closing' => true,
|
||||||
|
'no_useless_else' => true,
|
||||||
|
'no_unused_imports' => true,
|
||||||
|
'not_operator_with_successor_space' => false,
|
||||||
|
'not_operator_with_space' => false,
|
||||||
|
'ordered_class_elements' => true,
|
||||||
|
'php_unit_strict' => false,
|
||||||
|
'phpdoc_separation' => false,
|
||||||
|
]);
|
||||||
Loading…
x
Reference in New Issue
Block a user