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()
->setRules(array(
'@Symfony' => true,
'@Symfony:risky' => true,
2017-12-19 21:44:19 +00:00
'@PHPUnit48Migration:risky' => true,
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice
2016-12-03 09:46:32 +00:00
'array_syntax' => array('syntax' => 'long'),
2017-09-07 10:04:22 +01:00
'protected_to_private' => false,
2016-06-20 17:23:25 +01: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')
2017-09-07 10:04:22 +01:00
->append(array(__FILE__))
2015-03-24 21:20:39 +00:00
->exclude(array(
2018-06-23 08:40:50 +01:00
'Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures',
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
2018-06-07 15:35:59 +01:00
'Symfony/Component/Cache/Tests/Marshaller/Fixtures',
2017-01-21 16:45:58 +00:00
'Symfony/Component/DependencyInjection/Tests/Fixtures',
'Symfony/Component/Routing/Tests/Fixtures/dumper',
2015-03-24 21:20:39 +00:00
// fixture templates
2017-01-21 16:45:58 +00:00
'Symfony/Component/Templating/Tests/Fixtures/templates',
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
2016-06-21 06:43:49 +01:00
// generated fixtures
2017-01-21 16:53:15 +00:00
'Symfony/Component/VarDumper/Tests/Fixtures',
2015-03-24 21:20:39 +00:00
// resource templates
2017-01-21 16:45:58 +00:00
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
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')
2015-12-21 11:01:57 +00:00
// explicit heredoc test
2017-01-21 16:45:58 +00:00
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
2018-01-01 22:05:14 +00:00
// explicit trigger_error tests
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt')
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt')
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
2017-12-30 01:28:07 +00:00
// invalid annotations on purpose
->notPath('Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php')
2015-03-24 21:20:39 +00:00
)
2015-03-24 16:36:00 +00:00
;