| 1 |
<?php |
| 2 |
|
| 3 |
$header = 'The MIT License (MIT) |
| 4 |
|
| 5 |
Copyright (c) 2014-2020 Spomky-Labs |
| 6 |
|
| 7 |
This software may be modified and distributed under the terms |
| 8 |
of the MIT license. See the LICENSE file for details.'; |
| 9 |
|
| 10 |
$finder = PhpCsFixer\Finder::create() |
| 11 |
->in(__DIR__.'/src') |
| 12 |
->in(__DIR__.'/tests') |
| 13 |
; |
| 14 |
|
| 15 |
return PhpCsFixer\Config::create() |
| 16 |
->setRules([ |
| 17 |
'@PSR1' => true, |
| 18 |
'@PSR2' => true, |
| 19 |
'@PhpCsFixer' => true, |
| 20 |
'@Symfony' => true, |
| 21 |
'@DoctrineAnnotation' => true, |
| 22 |
'@PHP70Migration' => true, |
| 23 |
'@PHP71Migration' => true, |
| 24 |
'strict_param' => true, |
| 25 |
'strict_comparison' => true, |
| 26 |
'array_syntax' => ['syntax' => 'short'], |
| 27 |
'array_indentation' => true, |
| 28 |
'ordered_imports' => true, |
| 29 |
'protected_to_private' => true, |
| 30 |
'declare_strict_types' => true, |
| 31 |
'native_function_invocation' => [ |
| 32 |
'include' => ['@compiler_optimized'], |
| 33 |
'scope' => 'namespaced', |
| 34 |
'strict' => true, |
| 35 |
], |
| 36 |
'mb_str_functions' => true, |
| 37 |
'linebreak_after_opening_tag' => true, |
| 38 |
'combine_consecutive_issets' => true, |
| 39 |
'combine_consecutive_unsets' => true, |
| 40 |
'compact_nullable_typehint' => true, |
| 41 |
'no_superfluous_elseif' => true, |
| 42 |
'phpdoc_trim_consecutive_blank_line_separation' => true, |
| 43 |
'phpdoc_order' => true, |
| 44 |
'pow_to_exponentiation' => true, |
| 45 |
'simplified_null_return' => true, |
| 46 |
'header_comment' => [ |
| 47 |
'header' => $header, |
| 48 |
], |
| 49 |
'align_multiline_comment' => [ |
| 50 |
'comment_type' => 'all_multiline', |
| 51 |
], |
| 52 |
'php_unit_test_annotation' => [ |
| 53 |
'case' => 'snake', |
| 54 |
'style' => 'annotation', |
| 55 |
], |
| 56 |
'php_unit_test_case_static_method_calls' => true, |
| 57 |
'method_chaining_indentation' => true, |
| 58 |
'php_unit_expectation' => true, |
| 59 |
'php_unit_test_class_requires_covers' => false, |
| 60 |
'global_namespace_import' => [ |
| 61 |
'import_classes' => true, |
| 62 |
'import_constants' => true, |
| 63 |
'import_functions' => true, |
| 64 |
], |
| 65 |
]) |
| 66 |
->setRiskyAllowed(true) |
| 67 |
->setUsingCache(true) |
| 68 |
->setFinder($finder) |
| 69 |
; |