]> git.mxchange.org Git - friendica.git/blob - .php_cs.dist
update the release date in the CHANGELOG file
[friendica.git] / .php_cs.dist
1 <?php
2
3 declare(strict_types=1);
4
5 require_once __DIR__ . '/bin/dev/php-cs-fixer/vendor/autoload.php';
6
7 $finder = PhpCsFixer\Finder::create()
8         ->in(__DIR__)
9         ->notPath('bin/dev')
10         ->notPath('config')
11         ->notPath('doc')
12         ->notPath('images')
13         ->notPath('mods')
14         ->notPath('spec')
15         ->notPath('vendor')
16         ->notPath('view/asset')
17         ->notPath('lang')
18         ->notPath('view/smarty3/compiled');
19
20 $config = new PhpCsFixer\Config();
21 return $config
22         ->setRules([
23                 '@PSR1'                   => true,
24                 '@PSR2'                   => true,
25                 '@PSR12'                  => true,
26                 'align_multiline_comment' => true,
27                 'array_indentation'       => true,
28                 'array_syntax'            => [
29                         'syntax' => 'short',
30                 ],
31                 'binary_operator_spaces' => [
32                         'default'   => 'single_space',
33                         'operators' => [
34                                 '=>' => 'align_single_space_minimal',
35                                 '='  => 'align_single_space_minimal',
36                                 '??' => 'align_single_space_minimal',
37                         ],
38                 ],
39                 'blank_line_after_namespace'   => true,
40                 'braces'                       => [
41                         'position_after_anonymous_constructs'         => 'same',
42                         'position_after_control_structures'           => 'same',
43                         'position_after_functions_and_oop_constructs' => 'next',
44                 ],
45                 'elseif'               => true,
46                 'encoding'             => true,
47                 'full_opening_tag'     => true,
48                 'function_declaration' => [
49                         'closure_function_spacing' => 'one',
50                 ],
51                 'indentation_type' => true,
52                 'line_ending'      => true,
53                 'list_syntax'      => [
54                         'syntax' => 'long',
55                 ],
56                 'lowercase_keywords'                 => true,
57                 'method_argument_space'              => [],
58                 'no_closing_tag'                     => true,
59                 'no_spaces_after_function_name'      => true,
60                 'no_spaces_inside_parenthesis'       => true,
61                 'no_trailing_whitespace'             => true,
62                 'no_trailing_whitespace_in_comment'  => true,
63                 'no_unused_imports'                  => true,
64                 'single_blank_line_at_eof'           => true,
65                 'single_class_element_per_statement' => true,
66                 'single_import_per_statement'        => true,
67                 'single_line_after_imports'          => true,
68                 'switch_case_space'                  => true,
69                 'ternary_operator_spaces'            => false,
70                 'visibility_required'                => [
71                         'elements' => ['property', 'method']
72                 ],
73                 'new_with_braces' => true,
74         ])
75         ->setFinder($finder)
76         ->setIndent("\t");