Improvements for channel counter
[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('addon')
10         ->notPath('bin/dev')
11         ->notPath('config')
12         ->notPath('doc')
13         ->notPath('images')
14         ->notPath('mods')
15         ->notPath('spec')
16         ->notPath('vendor')
17         ->notPath('view/asset')
18         ->notPath('lang')
19         ->notPath('view/smarty3/compiled');
20
21 $config = new PhpCsFixer\Config();
22 return $config
23         ->setRules([
24                 '@PSR1'                   => true,
25                 '@PSR2'                   => true,
26                 '@PSR12'                  => true,
27                 'align_multiline_comment' => true,
28                 'array_indentation'       => true,
29                 'array_syntax'            => [
30                         'syntax' => 'short',
31                 ],
32                 'binary_operator_spaces' => [
33                         'default'   => 'single_space',
34                         'operators' => [
35                                 '=>' => 'align_single_space_minimal',
36                                 '='  => 'align_single_space_minimal',
37                                 '??' => 'align_single_space_minimal',
38                         ],
39                 ],
40                 'blank_line_after_namespace'   => true,
41                 'braces'                       => [
42                         'position_after_anonymous_constructs'         => 'same',
43                         'position_after_control_structures'           => 'same',
44                         'position_after_functions_and_oop_constructs' => 'next',
45                 ],
46                 'elseif'               => true,
47                 'encoding'             => true,
48                 'full_opening_tag'     => true,
49                 'function_declaration' => [
50                         'closure_function_spacing' => 'one',
51                 ],
52                 'indentation_type' => true,
53                 'line_ending'      => true,
54                 'list_syntax'      => [
55                         'syntax' => 'long',
56                 ],
57                 'lowercase_keywords'                 => true,
58                 'method_argument_space'              => [],
59                 'no_closing_tag'                     => true,
60                 'no_spaces_after_function_name'      => true,
61                 'no_spaces_inside_parenthesis'       => true,
62                 'no_trailing_whitespace'             => true,
63                 'no_trailing_whitespace_in_comment'  => true,
64                 'no_unused_imports'                  => true,
65                 'single_blank_line_at_eof'           => true,
66                 'single_class_element_per_statement' => true,
67                 'single_import_per_statement'        => true,
68                 'single_line_after_imports'          => true,
69                 'switch_case_space'                  => true,
70                 'ternary_operator_spaces'            => false,
71                 'visibility_required'                => [
72                         'elements' => ['property', 'method']
73                 ],
74                 'new_with_braces' => true,
75         ])
76         ->setFinder($finder)
77         ->setIndent("\t");