1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * This file is part of PHP CS Fixer.
7+ *
8+ * (c) Fabien Potencier <[email protected] > 9+ * Dariusz Rumiński <[email protected] > 10+ *
11+ * This source file is subject to the MIT license that is bundled
12+ * with this source code in the file LICENSE.
13+ */
14+
15+ $ config = new PhpCsFixer \Config ();
16+ $ config
17+ ->setRules ([
18+ '@PhpCsFixer:risky ' => true ,
19+ '@PSR2 ' => true ,
20+ 'concat_space ' => ['spacing ' => 'one ' ],
21+ 'no_unused_imports ' => true ,
22+ 'whitespace_after_comma_in_array ' => true ,
23+ 'method_argument_space ' => [
24+ 'keep_multiple_spaces_after_comma ' => true ,
25+ 'on_multiline ' => 'ignore '
26+ ],
27+ 'return_type_declaration ' => [
28+ 'space_before ' => 'none '
29+ ],
30+ // only converts simple strings in double quotes to single quotes
31+ // ignores strings using variables, escape characters or single quotes inside
32+ 'single_quote ' => true ,
33+ // there should be a single space b/w the cast and it's operand
34+ 'cast_spaces ' => ['space ' => 'single ' ],
35+ // there shouldn't be any trailing whitespace at the end of a non-blank line
36+ 'no_trailing_whitespace ' => true ,
37+ // there shouldn't be any trailing whitespace at the end of a blank line
38+ 'no_whitespace_in_blank_line ' => true ,
39+ // there should be a space around binary operators like (=, => etc)
40+ 'binary_operator_spaces ' => ['default ' => 'single_space ' ],
41+ // deals with rogue empty blank lines
42+ 'no_extra_blank_lines ' => ['tokens ' => ['extra ' ]],
43+ // reduces multi blank lines b/w phpdoc description and @param to a single line
44+ // NOTE: Doesn't add a blank line if none exist
45+ 'phpdoc_trim_consecutive_blank_line_separation ' => true ,
46+ 'native_function_invocation ' => false ,
47+ 'phpdoc_add_missing_param_annotation ' => ['only_untyped ' => false ],
48+ 'phpdoc_align ' => true ,
49+ 'phpdoc_return_self_reference ' => true ,
50+ 'phpdoc_types_order ' => ['sort_algorithm ' => 'alpha ' , 'null_adjustment ' => 'always_last ' ],
51+ 'phpdoc_to_comment ' => false ,
52+ 'phpdoc_var_without_name ' => false ,
53+
54+ ])
55+ ->setFinder (
56+ PhpCsFixer \Finder::create ()
57+ ->in (__DIR__ )
58+ );
59+
60+ return $ config ;
0 commit comments