summaryrefslogtreecommitdiff
path: root/.php_cs
blob: 52e60b6bce10ee1b865d4b7e5d388d58cca0d332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php

/*
 * webtrees: online genealogy
 * Copyright (C) 2017 webtrees development team
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

// https://github.com/FriendsOfPHP/PHP-CS-Fixer

$finder = PhpCsFixer\Finder::create()
	->in(__DIR__)
	->exclude('data/cache')
	->exclude('packages')
	->exclude('themes/_custom')
	->exclude('vendor');

return PhpCsFixer\Config::create()
	->setUsingCache(false)
	->setIndent("\t")
	->setFinder($finder)
	->setRiskyAllowed(true)
	->setRules([
		'@Symfony'                                  => true,
		'array_syntax'                              => ['syntax' => 'short'],
		'binary_operator_spaces'                    => ['align_double_arrow' => true, 'align_equals' => true],
		'class_definition'                          => false,
		'combine_consecutive_unsets'                => true,
		'concat_space'                              => ['spacing' => 'one'],
		'dir_constant'                              => true,
		'ereg_to_preg'                              => true,
		'linebreak_after_opening_tag'               => true,
		'modernize_types_casting'                   => true,
		'new_with_braces'                           => false,
		'no_blank_lines_before_namespace'           => true,
		'no_multiline_whitespace_before_semicolons' => true,
		'ordered_imports'                           => true,
		'single_blank_line_before_namespace'        => false,
	]);