|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +if (PHP_SAPI !== 'cli') { |
| 6 | + die('This script supports command line usage only. Please check your command.'); |
| 7 | +} |
| 8 | + |
| 9 | +return (new \PhpCsFixer\Config()) |
| 10 | + ->setFinder( |
| 11 | + (new \PhpCsFixer\Finder()) |
| 12 | + ->ignoreVCSIgnored(true) |
| 13 | + ->in([ |
| 14 | + __DIR__ . '/src/', |
| 15 | + __DIR__ . '/tests/', |
| 16 | + ]) |
| 17 | + ) |
| 18 | + ->setRiskyAllowed(true) |
| 19 | + ->setRules([ |
| 20 | + '@PSR2' => true, |
| 21 | + '@DoctrineAnnotation' => true, |
| 22 | + 'no_leading_import_slash' => true, |
| 23 | + 'array_syntax' => ['syntax' => 'short'], |
| 24 | + 'cast_spaces' => ['space' => 'none'], |
| 25 | + 'concat_space' => ['spacing' => 'one'], |
| 26 | + 'declare_equal_normalize' => ['space' => 'single'], |
| 27 | + 'dir_constant' => true, |
| 28 | + 'function_typehint_space' => true, |
| 29 | + 'lowercase_cast' => true, |
| 30 | + 'native_function_casing' => true, |
| 31 | + 'no_alias_functions' => true, |
| 32 | + 'no_blank_lines_after_phpdoc' => true, |
| 33 | + 'no_empty_statement' => true, |
| 34 | + 'no_leading_namespace_whitespace' => true, |
| 35 | + 'no_short_bool_cast' => true, |
| 36 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 37 | + 'no_superfluous_elseif' => true, |
| 38 | + 'no_trailing_comma_in_singleline_array' => true, |
| 39 | + 'no_unneeded_control_parentheses' => true, |
| 40 | + 'no_unused_imports' => true, |
| 41 | + 'no_useless_else' => true, |
| 42 | + 'no_whitespace_in_blank_line' => true, |
| 43 | + 'ordered_imports' => true, |
| 44 | + 'phpdoc_no_access' => true, |
| 45 | + 'phpdoc_no_empty_return' => true, |
| 46 | + 'phpdoc_no_package' => true, |
| 47 | + 'phpdoc_scalar' => true, |
| 48 | + 'phpdoc_trim' => true, |
| 49 | + 'phpdoc_types' => true, |
| 50 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 51 | + 'return_type_declaration' => ['space_before' => 'none'], |
| 52 | + 'single_quote' => true, |
| 53 | + 'whitespace_after_comma_in_array' => true, |
| 54 | + ]); |
0 commit comments