PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
bedrock-protocol/.php-cs-fixer.php
1<?php
2
3$finder = PhpCsFixer\Finder::create()
4 ->in(__DIR__ . '/src')
5 ->in(__DIR__ . '/tools')
6 ->in(__DIR__ . '/tests');
7
8return (new PhpCsFixer\Config)
9 ->setRiskyAllowed(true)
10 ->setRules([
11 'align_multiline_comment' => [
12 'comment_type' => 'phpdocs_only'
13 ],
14 'array_indentation' => true,
15 'array_syntax' => [
16 'syntax' => 'short'
17 ],
18 'binary_operator_spaces' => [
19 'default' => 'single_space'
20 ],
21 'blank_line_after_namespace' => true,
22 'blank_line_after_opening_tag' => true,
23 'blank_line_before_statement' => [
24 'statements' => [
25 'declare'
26 ]
27 ],
28 'cast_spaces' => [
29 'space' => 'single'
30 ],
31 'concat_space' => [
32 'spacing' => 'one'
33 ],
34 'declare_strict_types' => true,
35 'elseif' => true,
36 'fully_qualified_strict_types' => true,
37 'global_namespace_import' => [
38 'import_constants' => true,
39 'import_functions' => true,
40 'import_classes' => null,
41 ],
42 'header_comment' => [
43 'header' => <<<COMMENT
44This file is part of BedrockProtocol.
45Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
46
47BedrockProtocol is free software: you can redistribute it and/or modify
48it under the terms of the GNU Lesser General Public License as published by
49the Free Software Foundation, either version 3 of the License, or
50(at your option) any later version.
51COMMENT,
52 'location' => 'after_open',
53 ],
54 'indentation_type' => true,
55 'native_function_invocation' => [
56 'scope' => 'namespaced',
57 'include' => ['@all'],
58 ],
59 'no_closing_tag' => true,
60 'no_empty_phpdoc' => true,
61 'no_extra_blank_lines' => true,
62 'no_superfluous_phpdoc_tags' => [
63 'allow_mixed' => true,
64 ],
65 'no_trailing_whitespace' => true,
66 'no_trailing_whitespace_in_comment' => true,
67 'no_whitespace_in_blank_line' => true,
68 'no_unused_imports' => true,
69 'ordered_imports' => [
70 'imports_order' => [
71 'class',
72 'function',
73 'const',
74 ],
75 'sort_algorithm' => 'alpha'
76 ],
77 'phpdoc_line_span' => [
78 'property' => 'single',
79 'method' => null,
80 'const' => null
81 ],
82 'phpdoc_trim' => true,
83 'phpdoc_trim_consecutive_blank_line_separation' => true,
84 'return_type_declaration' => [
85 'space_before' => 'one'
86 ],
87 'single_blank_line_at_eof' => true,
88 'single_import_per_statement' => true,
89 'strict_param' => true,
90 'unary_operator_spaces' => true,
91 ])
92 ->setFinder($finder)
93 ->setIndent("\t")
94 ->setLineEnding("\n");