|
18 | 18 | ->notPath('/var\/classes/') |
19 | 19 | ; |
20 | 20 |
|
21 | | -// do not enable self_accessor as it breaks pimcore models relying on get_called_class() |
22 | | -return PhpCsFixer\Config::create() |
23 | | - ->setRules([ |
| 21 | +$config = new PhpCsFixer\Config(); |
| 22 | +$config->setRules([ |
24 | 23 | '@PSR1' => true, |
25 | 24 | '@PSR2' => true, |
26 | 25 | 'array_syntax' => ['syntax' => 'short'], |
27 | 26 |
|
28 | 27 | 'header_comment' => [ |
29 | | - 'commentType' => 'PHPDoc', |
30 | | - 'header' => 'Pimcore' . PHP_EOL . PHP_EOL . |
31 | | - 'This source file is available under two different licenses:' . PHP_EOL . |
32 | | - '- GNU General Public License version 3 (GPLv3)' . PHP_EOL . |
33 | | - '- Pimcore Commercial License (PCL)' . PHP_EOL . |
34 | | - 'Full copyright and license information is available in' . PHP_EOL . |
35 | | - 'LICENSE.md which is distributed with this source code.' . PHP_EOL . |
36 | | - PHP_EOL . |
37 | | - ' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL . |
38 | | - ' @license http://www.pimcore.org/license GPLv3 and PCL' |
39 | | - ], |
| 28 | + 'comment_type' => 'PHPDoc', |
| 29 | + 'header' => |
| 30 | + 'This source file is available under the terms of the' . PHP_EOL . |
| 31 | + 'Pimcore Open Core License (POCL)' . PHP_EOL . |
| 32 | + 'Full copyright and license information is available in' . PHP_EOL . |
| 33 | + 'LICENSE.md which is distributed with this source code.' . PHP_EOL . |
| 34 | + PHP_EOL . |
| 35 | + ' @copyright Copyright (c) Pimcore GmbH (https://www.pimcore.com)' . PHP_EOL . |
| 36 | + ' @license Pimcore Open Core License (POCL)' |
| 37 | + ], |
40 | 38 |
|
41 | | - // keep aligned = and => operators as they are: do not force aligning, but do not remove it |
42 | | - 'binary_operator_spaces' => ['align_double_arrow' => null, 'align_equals' => null], |
43 | | - |
44 | | - 'blank_line_before_return' => true, |
| 39 | + 'blank_line_before_statement' => true, |
45 | 40 | 'encoding' => true, |
46 | 41 | 'function_typehint_space' => true, |
47 | | - 'hash_to_slash_comment' => true, |
| 42 | + 'single_line_comment_style' => true, |
48 | 43 | 'lowercase_cast' => true, |
49 | 44 | 'magic_constant_casing' => true, |
50 | | - 'method_argument_space' => ['ensure_fully_multiline' => false], |
51 | | - 'method_separation' => true, |
| 45 | + 'method_argument_space' => ['on_multiline' => 'ignore'], |
| 46 | + 'class_attributes_separation' => true, |
52 | 47 | 'native_function_casing' => true, |
53 | 48 | 'no_blank_lines_after_class_opening' => true, |
54 | 49 | 'no_blank_lines_after_phpdoc' => true, |
55 | 50 | 'no_empty_comment' => true, |
56 | 51 | 'no_empty_phpdoc' => true, |
57 | 52 | 'no_empty_statement' => true, |
58 | | - 'no_extra_consecutive_blank_lines' => true, |
| 53 | + 'no_extra_blank_lines' => true, |
59 | 54 | 'no_leading_import_slash' => true, |
60 | 55 | 'no_leading_namespace_whitespace' => true, |
61 | 56 | 'no_short_bool_cast' => true, |
|
80 | 75 | 'standardize_not_equals' => true, |
81 | 76 | 'ternary_operator_spaces' => true, |
82 | 77 | 'whitespace_after_comma_in_array' => true, |
83 | | - ]) |
84 | | - ->setFinder($finder); |
| 78 | +]); |
| 79 | + |
| 80 | +$config->setFinder($finder); |
| 81 | +return $config; |
| 82 | + |
0 commit comments