This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/.php_cs.dist

55 lines
2.8 KiB
Plaintext
Raw Normal View History

<?php
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,
'@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'),
2018-07-26 10:03:18 +01:00
'ordered_imports' => 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' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'),
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')
->append(array(__FILE__))
2015-03-24 21:20:39 +00:00
->exclude(array(
'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
'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/Fixtures/TemplatePathsCache',
2017-01-21 16:45:58 +00:00
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
2016-06-21 06:43:49 +01:00
// generated fixtures
'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',
// explicit trigger_error tests
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
2015-03-24 21:20:39 +00:00
))
// Support for older PHPunit version
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
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')
// explicit trigger_error tests
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
// invalid annotations on purpose
->notPath('Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php')
2015-03-24 21:20:39 +00:00
)
;