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-fixer.dist.php

50 lines
2.2 KiB
PHP
Raw Normal View History

<?php
if (!file_exists(__DIR__.'/src')) {
exit(0);
}
return (new PhpCsFixer\Config())
2019-01-16 20:35:37 +00:00
->setRules([
2021-01-10 02:20:21 +00:00
'@PHP71Migration' => true,
2021-01-14 15:08:15 +00:00
'@PHPUnit75Migration:risky' => true,
2016-12-03 09:46:32 +00:00
'@Symfony' => true,
'@Symfony:risky' => true,
'protected_to_private' => false,
2021-12-16 21:17:20 +00:00
'native_constant_invocation' => ['strict' => false],
2021-06-30 14:02:00 +01:00
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
2019-01-16 20:35:37 +00:00
])
2016-12-03 09:46:32 +00:00
->setRiskyAllowed(true)
->setFinder(
(new PhpCsFixer\Finder())
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',
// explicit trigger_error tests
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
'Symfony/Component/Intl/Resources/data/',
2019-01-16 20:35:37 +00: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')
// file content autogenerated by `VarExporter::export`
->notPath('Symfony/Component/Serializer/Tests/Fixtures/serializer.class.metadata.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')
// explicit trigger_error tests
->notPath('Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php')
// stop removing spaces on the end of the line in strings
->notPath('Symfony/Component/Messenger/Tests/Command/FailedMessagesShowCommandTest.php')
2015-03-24 21:20:39 +00:00
)
->setCacheFile('.php-cs-fixer.cache')
;