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.7 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()
2019-01-16 09:39:14 +00:00
->setRules([
2016-12-03 09:46:32 +00:00
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHPUnit75Migration:risky' => true,
2019-08-04 17:55:16 +01:00
'php_unit_dedicate_assert' => ['target' => '5.6'],
'phpdoc_no_empty_return' => false, // triggers almost always false positive
2019-01-16 09:39:14 +00:00
'array_syntax' => ['syntax' => 'short'],
2018-10-02 12:58:25 +01:00
'fopen_flags' => false,
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
2019-06-13 11:34:15 +01:00
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
2018-10-09 00:34:45 +01:00
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
2019-01-16 09:39:14 +00:00
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
])
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 09:39:14 +00:00
->append([__FILE__])
->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
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/',
2019-01-16 09:39:14 +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')
2015-03-24 21:20:39 +00:00
)
;