c709d43878
* 4.3: Remove Google references when not needed Simplify usage of dirname() Remove Google references when not needed
54 lines
2.5 KiB
PHP
54 lines
2.5 KiB
PHP
<?php
|
|
|
|
if (!file_exists(__DIR__.'/src')) {
|
|
exit(0);
|
|
}
|
|
|
|
return PhpCsFixer\Config::create()
|
|
->setRules([
|
|
'@Symfony' => true,
|
|
'@Symfony:risky' => true,
|
|
'@PHPUnit75Migration:risky' => true,
|
|
'php_unit_dedicate_assert' => ['target' => '5.6'],
|
|
'phpdoc_no_empty_return' => false, // triggers almost always false positive
|
|
'array_syntax' => ['syntax' => 'short'],
|
|
'fopen_flags' => false,
|
|
'ordered_imports' => true,
|
|
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
|
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
|
|
'protected_to_private' => false,
|
|
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
|
|
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
|
|
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
|
|
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
|
|
'combine_nested_dirname' => true,
|
|
])
|
|
->setRiskyAllowed(true)
|
|
->setFinder(
|
|
PhpCsFixer\Finder::create()
|
|
->in(__DIR__.'/src')
|
|
->append([__FILE__])
|
|
->notPath('#/Fixtures/#')
|
|
->exclude([
|
|
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
|
|
// fixture templates
|
|
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
|
|
// resource templates
|
|
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
|
|
// explicit trigger_error tests
|
|
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
|
|
])
|
|
// Support for older PHPunit version
|
|
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
|
|
->notPath('#Symfony/Bridge/PhpUnit/.*Mock\.php#')
|
|
->notPath('#Symfony/Bridge/PhpUnit/.*Legacy#')
|
|
// file content autogenerated by `var_export`
|
|
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
|
|
// test template
|
|
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
|
|
// explicit trigger_error tests
|
|
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
|
|
->notPath('Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php')
|
|
)
|
|
;
|