2015-03-24 16:36:00 +00:00
|
|
|
<?php
|
|
|
|
|
2017-09-08 14:50:13 +01:00
|
|
|
if (!file_exists(__DIR__.'/src')) {
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2016-12-03 09:46:32 +00:00
|
|
|
return PhpCsFixer\Config::create()
|
2019-01-16 20:35:37 +00:00
|
|
|
->setRules([
|
2016-12-03 09:46:32 +00:00
|
|
|
'@Symfony' => true,
|
|
|
|
'@Symfony:risky' => true,
|
2019-08-02 14:23:07 +01:00
|
|
|
'@PHPUnit75Migration:risky' => true,
|
2019-08-04 17:55:16 +01:00
|
|
|
'php_unit_dedicate_assert' => ['target' => '5.6'],
|
2019-01-16 20:35:37 +00:00
|
|
|
'array_syntax' => ['syntax' => 'short'],
|
2018-10-02 12:58:25 +01:00
|
|
|
'fopen_flags' => false,
|
2017-09-07 10:04:22 +01:00
|
|
|
'protected_to_private' => false,
|
2020-09-02 17:06:40 +01:00
|
|
|
'native_constant_invocation' => true,
|
2019-09-10 10:15:55 +01:00
|
|
|
'combine_nested_dirname' => true,
|
2020-10-28 07:52:32 +00:00
|
|
|
'list_syntax' => ['syntax' => 'short'],
|
2020-12-08 17:00:58 +00:00
|
|
|
'visibility_required' => ['property', 'method', 'const'],
|
2020-12-26 23:49:32 +00:00
|
|
|
'ternary_to_null_coalescing' => true,
|
2019-01-16 20:35:37 +00:00
|
|
|
])
|
2016-12-03 09:46:32 +00:00
|
|
|
->setRiskyAllowed(true)
|
|
|
|
->setFinder(
|
|
|
|
PhpCsFixer\Finder::create()
|
2017-01-20 15:16:44 +00:00
|
|
|
->in(__DIR__.'/src')
|
2019-01-16 20:35:37 +00:00
|
|
|
->append([__FILE__])
|
2019-08-13 21:27:05 +01:00
|
|
|
->notPath('#/Fixtures/#')
|
2019-01-16 20:35:37 +00:00
|
|
|
->exclude([
|
2015-03-24 21:20:39 +00:00
|
|
|
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
|
|
|
|
// fixture templates
|
2017-01-21 16:45:58 +00:00
|
|
|
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
|
2015-03-24 21:20:39 +00:00
|
|
|
// resource templates
|
2017-01-21 16:45:58 +00:00
|
|
|
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
|
2018-07-05 11:52:40 +01:00
|
|
|
// explicit trigger_error tests
|
|
|
|
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
|
2019-01-16 20:35:37 +00:00
|
|
|
])
|
2018-07-05 11:52:40 +01:00
|
|
|
// Support for older PHPunit version
|
|
|
|
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
|
2019-08-13 21:27:05 +01:00
|
|
|
->notPath('#Symfony/Bridge/PhpUnit/.*Mock\.php#')
|
|
|
|
->notPath('#Symfony/Bridge/PhpUnit/.*Legacy#')
|
2015-03-24 21:20:39 +00:00
|
|
|
// file content autogenerated by `var_export`
|
2017-01-21 16:45:58 +00:00
|
|
|
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
|
2015-03-24 21:20:39 +00:00
|
|
|
// test template
|
2017-01-21 16:45:58 +00:00
|
|
|
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
|
2018-01-01 22:05:14 +00:00
|
|
|
// explicit trigger_error tests
|
|
|
|
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
|
2019-08-06 11:43:51 +01:00
|
|
|
->notPath('Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php')
|
2015-03-24 21:20:39 +00:00
|
|
|
)
|
2015-03-24 16:36:00 +00:00
|
|
|
;
|