|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | +declare(strict_types=1); |
| 4 | + |
3 | 5 | /**
|
4 |
| - * @generated |
5 |
| - * @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst |
| 6 | + * This file is part of the CsasWebApi package |
| 7 | + * |
| 8 | + * https://github.com/Spoje-NET/php-csas-webapi |
| 9 | + * |
| 10 | + * (c) SpojeNetIT <http://spoje.net/> |
| 11 | + * |
| 12 | + * For the full copyright and license information, please view the LICENSE |
| 13 | + * file that was distributed with this source code. |
6 | 14 | */
|
7 |
| -$finder = PhpCsFixer\Finder::create() |
8 |
| - ->in(__DIR__) |
9 |
| - ->exclude('vendor') |
10 |
| - ->exclude('test') |
11 |
| - ->exclude('tests') |
12 |
| -; |
13 |
| - |
14 |
| -$config = new PhpCsFixer\Config(); |
15 |
| -return $config->setRules([ |
16 |
| - '@PSR12' => true, |
17 |
| - 'phpdoc_order' => true, |
18 |
| - 'array_syntax' => [ 'syntax' => 'short' ], |
19 |
| - 'strict_comparison' => true, |
20 |
| - 'strict_param' => true, |
21 |
| - 'no_trailing_whitespace' => false, |
22 |
| - 'no_trailing_whitespace_in_comment' => false, |
23 |
| - 'single_space_around_construct' => true, |
24 |
| - 'single_blank_line_at_eof' => false, |
25 |
| - 'blank_line_after_namespace' => false, |
26 |
| - 'no_leading_import_slash' => false, |
| 15 | + |
| 16 | +use Ergebnis\PhpCsFixer\Config\Factory; |
| 17 | +use Ergebnis\PhpCsFixer\Config\Rules; |
| 18 | +use Ergebnis\PhpCsFixer\Config\RuleSet\Php74; |
| 19 | + |
| 20 | +$header = <<<'HEADER' |
| 21 | +This file is part of the CsasWebApi package |
| 22 | +
|
| 23 | +https://github.com/Spoje-NET/php-csas-webapi |
| 24 | +
|
| 25 | +(c) SpojeNetIT <http://spoje.net/> |
| 26 | +
|
| 27 | +For the full copyright and license information, please view the LICENSE |
| 28 | +file that was distributed with this source code. |
| 29 | +HEADER; |
| 30 | + |
| 31 | +$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([ |
| 32 | + 'blank_line_before_statement' => [ |
| 33 | + 'statements' => [ |
| 34 | + 'break', |
| 35 | + 'continue', |
| 36 | + 'declare', |
| 37 | + 'default', |
| 38 | + 'do', |
| 39 | + 'exit', |
| 40 | + 'for', |
| 41 | + 'foreach', |
| 42 | + 'goto', |
| 43 | + 'if', |
| 44 | + 'include', |
| 45 | + 'include_once', |
| 46 | + 'require', |
| 47 | + 'require_once', |
| 48 | + 'return', |
| 49 | + 'switch', |
| 50 | + 'throw', |
| 51 | + 'try', |
| 52 | + 'while', |
| 53 | + ], |
| 54 | + ], |
| 55 | + 'concat_space' => [ |
| 56 | + 'spacing' => 'none', |
| 57 | + ], |
| 58 | + 'date_time_immutable' => false, |
| 59 | + 'error_suppression' => false, |
| 60 | + 'final_class' => false, |
| 61 | + 'mb_str_functions' => false, |
| 62 | + 'native_function_invocation' => [ |
| 63 | + 'exclude' => [ |
| 64 | + 'sprintf', |
| 65 | + ], |
| 66 | + 'include' => [ |
| 67 | + '@compiler_optimized', |
| 68 | + ], |
| 69 | + 'scope' => 'all', |
| 70 | + 'strict' => false, |
| 71 | + ], |
| 72 | + 'php_unit_internal_class' => false, |
| 73 | + 'php_unit_test_annotation' => [ |
| 74 | + 'style' => 'prefix', |
| 75 | + ], |
| 76 | + 'php_unit_test_class_requires_covers' => false, |
| 77 | + 'return_to_yield_from' => false, |
| 78 | + 'phpdoc_array_type' => false, |
| 79 | + 'phpdoc_list_type' => false, |
| 80 | + 'attribute_empty_parentheses' => false, |
| 81 | + 'final_public_method_for_abstract_class' => false, |
| 82 | + 'class_attributes_separation' => [ |
| 83 | + 'elements' => [ |
| 84 | + 'const' => 'only_if_meta', |
| 85 | + 'property' => 'only_if_meta', |
| 86 | + 'trait_import' => 'none', |
| 87 | + 'case' => 'none', |
| 88 | + ], |
| 89 | + ], |
| 90 | + 'yoda_style' => false, |
| 91 | + 'php_unit_test_case_static_method_calls' => false, |
| 92 | +])); |
| 93 | + |
| 94 | +$config = Factory::fromRuleSet($ruleSet); |
| 95 | + |
| 96 | +$config->getFinder() |
| 97 | + ->append([ |
| 98 | + __DIR__.'/.php-cs-fixer.dist.php', |
27 | 99 | ])
|
28 |
| - ->setFinder($finder) |
29 |
| -; |
| 100 | + ->in('Examples') |
| 101 | + ->in('lib') |
| 102 | + ->in('test'); |
| 103 | + |
| 104 | +$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache'); |
| 105 | + |
| 106 | +return $config; |
0 commit comments