Merge pull request #10140 from annando/summary-mention
[friendica.git/.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                         ],
37                 ],
38                 'blank_line_after_namespace'   => true,
39                 'braces'                       => [
40                         'position_after_anonymous_constructs'         => 'same',
41                         'position_after_control_structures'           => 'same',
42                         'position_after_functions_and_oop_constructs' => 'next',
43                 ],
44                 'elseif'               => true,
45                 'encoding'             => true,
46                 'full_opening_tag'     => true,
47                 'function_declaration' => [
48                         'closure_function_spacing' => 'one',
49                 ],
50                 'indentation_type' => true,
51                 'line_ending'      => true,
52                 'list_syntax'      => [
53                         'syntax' => 'long',
54                 ],
55                 'lowercase_keywords'                 => true,
56                 'method_argument_space'              => [],
57                 'no_closing_tag'                     => true,
58                 'no_spaces_after_function_name'      => true,
59                 'no_spaces_inside_parenthesis'       => true,
60                 'no_trailing_whitespace'             => true,
61                 'no_trailing_whitespace_in_comment'  => true,
62                 'no_unused_imports'                  => true,
63                 'single_blank_line_at_eof'           => true,
64                 'single_class_element_per_statement' => true,
65                 'single_import_per_statement'        => true,
66                 'single_line_after_imports'          => true,
67                 'switch_case_space'                  => true,
68                 'visibility_required'                => [
69                         'elements' => ['property', 'method']
70                 ],
71                 'new_with_braces' => true,
72         ])
73         ->setFinder($finder)
74         ->setIndent("\t");