代码拉取完成,页面将自动刷新
同步操作将从 宇润/imi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
declare(strict_types=1);
if (!file_exists(__DIR__ . '/src'))
{
exit(0);
}
return (new PhpCsFixer\Config())
->setRules([
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@DoctrineAnnotation' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align_single_space',
],
],
'concat_space' => [
'spacing' => 'one',
],
'fopen_flags' => false,
'protected_to_private' => false,
'native_function_invocation' => true,
'native_constant_invocation' => true,
'combine_nested_dirname' => true,
'single_quote' => true,
'single_space_around_construct' => [
'constructs_followed_by_a_single_space' => [
'abstract',
'as',
'attribute',
'break',
'case',
'catch',
'class',
'clone',
'comment',
'const',
'const_import',
'continue',
'do',
'echo',
'else',
'elseif',
'enum',
'extends',
'final',
'finally',
'for',
'foreach',
'function',
'function_import',
'global',
'goto',
'if',
'implements',
'include',
'include_once',
'instanceof',
'insteadof',
'interface',
'match',
'named_argument',
// 'namespace', // 兼容性移除
'new',
'open_tag_with_echo',
'php_doc',
'php_open',
'print',
'private',
'protected',
'public',
'readonly',
'require',
'require_once',
'return',
'static',
'switch',
'throw',
'trait',
'try',
'type_colon',
'use',
'use_lambda',
'use_trait',
'var',
'while',
'yield',
'yield_from',
],
],
'control_structure_continuation_position' => [
'position' => 'next_line',
],
'single_line_comment_style' => false,
'phpdoc_to_comment' => false,
'declare_strict_types' => true,
'heredoc_indentation' => [
'indentation' => 'same_as_start',
],
'no_trailing_whitespace_in_string' => false,
'static_lambda' => true,
'modernize_strpos' => true,
'regular_callable_call' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'explicit_indirect_variable' => true,
'no_useless_return' => true,
'return_assignment' => true,
'explicit_string_variable' => true,
'heredoc_to_nowdoc' => true,
'void_return' => false, // BUG:https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/6690
// Symfony 冲突
'curly_braces_position' => [
'control_structures_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'nullable_type_declaration_for_default_null_value' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'allow_unused_params' => false,
'remove_inheritdoc' => false,
],
'no_null_property_initialization' => false,
// 当支持 php>=8.0 后改配置可以移除
'get_class_to_class_keyword' => false,
])
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->notName('*.macro.php')
->notPath('src/Components/swoole/src/Util/Coroutine.typed.php') // 兼容 Swoole 5.0,需要 PHP >= 8.0
->notPath('src/Components/hprose/src/Imi-Server-Hprose/Server.php') // bug: https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/6534
->notPath('src/Components/grpc/example/grpc')
)
;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。