1

我们有这样的简单数组

return ['env' => 'release',
'mode' => 'normal',
'theme' => 'basic',
'redis' => require __DIR__.'/redis.php',
];

如何在数组大括号示例之后(空行)后添加新行

return [ // new line after brace
    'env' => 'release',
    'mode' => 'normal',
    'theme' => 'basic',
    'redis' => require __DIR__ . '/redis.php',
];

我试过这个配置,但没有用

<?php

$finder = PhpCsFixer\Finder::create()
    ->name('*.php.j2')
    ->in(__DIR__ . '/test');

return PhpCsFixer\Config::create()
    ->setRules([
        '@Symfony' => true,
        'array_syntax' => ['syntax' => 'short'],
        'braces' => [
            'position_after_anonymous_constructs' => 'next', // this  for functions
            'position_after_control_structures' => 'next' // this for if-else structures
        ]
    ])
    ->setFinder($finder);
4

0 回答 0