-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php-cs-fixer.dist.php
75 lines (67 loc) · 2.36 KB
/
.php-cs-fixer.dist.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php declare(strict_types=1);
/*
* This file is part of the ForciPdfGeneratorBundle package.
*
* Copyright (c) Forci Web Consulting Ltd.
*
* Author Martin Kirilov <martin@forci.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$date = date('Y');
$headerComment = <<<COMMENT
This file is part of the ForciPdfGeneratorBundle package.
Copyright (c) Forci Web Consulting Ltd.
Author Martin Kirilov <martin@forci.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT;
$finder = Finder::create()->in([
__DIR__ . '/src',
]);
return (new Config())
->setRules([
'@Symfony' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'array_syntax' => [
'syntax' => 'short',
],
'trailing_comma_in_multiline' => true,
'concat_space' => [
'spacing' => 'one',
],
'cast_spaces' => [
'space' => 'none',
],
'function_declaration' => [
// closure_function_spacing ('none', 'one'): spacing to use before open parenthesis for closures;
// defaults to 'one'
'closure_function_spacing' => 'one',
],
'phpdoc_align' => [
'align' => 'left',
],
'single_line_throw' => false,
'header_comment' => [
'comment_type' => 'comment',
'header' => $headerComment,
// separate ('both', 'bottom', 'none', 'top'):
// whether the header should be separated from the file content with a new line; defaults to 'both'
'separate' => 'bottom',
],
// Could use that and separate header comment bottom only
// But any blank lines added by hand aren't removed and are only reduced to 1
// Ensure there is no code on the same line as the PHP open tag.
'linebreak_after_opening_tag' => false,
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
])
->setRiskyAllowed(true)
->setUsingCache(true)
->setFinder($finder);