2024-02-04 04:39:13 +00:00
|
|
|
<?php
|
|
|
|
|
2024-07-12 22:56:04 +00:00
|
|
|
$finder = PhpCsFixer\Finder::create()
|
2024-07-30 03:36:45 +00:00
|
|
|
->in(__DIR__ . '/src')
|
2024-07-12 22:56:04 +00:00
|
|
|
->in(__DIR__ . '/tests');
|
2024-02-04 04:39:13 +00:00
|
|
|
|
2024-07-12 22:56:04 +00:00
|
|
|
$config = new PhpCsFixer\Config();
|
|
|
|
return $config->setRules([
|
2024-02-04 04:39:13 +00:00
|
|
|
//Symfony
|
|
|
|
'@Symfony' => true,
|
|
|
|
'@Symfony:risky' => true,
|
|
|
|
|
|
|
|
//PHP Version Migration
|
|
|
|
'@PHP74Migration' => true,
|
|
|
|
'@PHP74Migration:risky' => true,
|
|
|
|
'@PHP80Migration' => true,
|
|
|
|
'@PHP80Migration:risky' => true,
|
|
|
|
|
2024-07-12 22:56:04 +00:00
|
|
|
//PHPUnit Version Migration
|
2024-02-04 04:39:13 +00:00
|
|
|
'@PHPUnit84Migration:risky' => true,
|
|
|
|
|
|
|
|
//General
|
|
|
|
'array_indentation' => true,
|
|
|
|
'compact_nullable_typehint' => true,
|
2024-07-12 22:56:04 +00:00
|
|
|
'concat_space' => ['spacing' => 'one'],
|
2024-02-04 04:39:13 +00:00
|
|
|
'method_chaining_indentation' => true,
|
2024-07-12 22:56:04 +00:00
|
|
|
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
|
|
|
|
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
|
2024-02-04 04:39:13 +00:00
|
|
|
'phpdoc_order' => true,
|
2024-07-12 22:56:04 +00:00
|
|
|
'visibility_required' => ['elements' => ['property', 'method', 'const']],
|
2024-02-04 04:39:13 +00:00
|
|
|
'yoda_style' => false,
|
|
|
|
'octal_notation' => false,
|
2024-07-12 22:56:04 +00:00
|
|
|
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
|
2024-02-04 04:39:13 +00:00
|
|
|
'global_namespace_import' => [
|
|
|
|
'import_classes' => true,
|
|
|
|
'import_constants' => true,
|
2024-07-12 22:56:04 +00:00
|
|
|
'import_functions' => true,
|
2024-02-04 04:39:13 +00:00
|
|
|
],
|
|
|
|
'no_superfluous_phpdoc_tags' => [
|
|
|
|
'allow_mixed' => true,
|
2024-07-12 22:56:04 +00:00
|
|
|
'remove_inheritdoc' => true,
|
|
|
|
],
|
2024-02-04 04:39:13 +00:00
|
|
|
])->setFinder($finder);
|