-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.php-cs-fixer.php
54 lines (45 loc) · 1.82 KB
/
.php-cs-fixer.php
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
49
50
51
52
53
54
<?php
declare(strict_types=1);
/*
* This file is part of the composer-link plugin.
*
* Copyright (c) 2021-2023 Sander Visser <[email protected]>.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*
* @link https://github.com/SanderSander/composer-link
*/
$finder = PhpCsFixer\Finder::create()
->exclude(['vendor'])
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$header = 'This file is part of the composer-link plugin.
Created by: Sander Visser <[email protected]>.
For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
@link https://github.com/SanderSander/composer-link';
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PSR12:risky' => true,
'@Symfony' => true,
'strict_param' => true,
'declare_strict_types' => true,
'no_unused_imports' => true,
'php_unit_test_case_static_method_calls' => true,
'single_blank_line_at_eof' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'header_comment' => ['header' => $header],
'php_unit_method_casing' => ['case' => 'snake_case'],
'concat_space' => ['spacing' => 'one'],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
'single_line_throw' => false,
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => false],
])->setFinder($finder);