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

46 lines
2.2 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'),
'protected_to_private' => false,
// rule disabled due to https://bugs.php.net/bug.php?id=60573 bug;
// to be re-enabled (by dropping next line, rule is part of @Symfony already) on branch that requires PHP 5.4+
'self_accessor' => 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')
->append(array(__FILE__))
2015-03-24 21:20:39 +00:00
->exclude(array(
// 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/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',
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/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt')
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt')
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
2015-03-24 21:20:39 +00:00
)
;