Browse code

Adjust some project configs and presets

Benjamin Roth authored on26/11/2018 22:15:36
Showing1 changed files
... ...
@@ -17,6 +17,8 @@ return PhpCsFixer\Config::create()
17 17
     ->setRules([
18 18
         '@Symfony' => true,
19 19
         '@Symfony:risky' => true,
20
+        '@PHP71Migration' => true,
21
+        '@PHP71Migration:risky' => true,
20 22
         '@PHPUnit60Migration:risky' => true,
21 23
         'align_multiline_comment' => true,
22 24
         'array_syntax' => ['syntax' => 'short'],
Browse code

Initial Commit

Benjamin Roth authored on26/11/2018 15:55:30
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+<?php
2
+
3
+$header = <<<EOF
4
+This file is part of eSales Media SinglereisenBundle.
5
+
6
+(c) Benjamin Roth
7
+
8
+@license proprietary
9
+EOF;
10
+
11
+$finder = PhpCsFixer\Finder::create()
12
+    ->exclude('Resources')
13
+    ->in([__DIR__.'/src', __DIR__.'/tests'])
14
+;
15
+
16
+return PhpCsFixer\Config::create()
17
+    ->setRules([
18
+        '@Symfony' => true,
19
+        '@Symfony:risky' => true,
20
+        '@PHPUnit60Migration:risky' => true,
21
+        'align_multiline_comment' => true,
22
+        'array_syntax' => ['syntax' => 'short'],
23
+        'combine_consecutive_issets' => true,
24
+        'combine_consecutive_unsets' => true,
25
+        'compact_nullable_typehint' => true,
26
+        'general_phpdoc_annotation_remove' => [
27
+            'expectedException',
28
+            'expectedExceptionMessage',
29
+        ],
30
+        'header_comment' => ['header' => $header],
31
+        'heredoc_to_nowdoc' => true,
32
+        'linebreak_after_opening_tag' => true,
33
+        'no_null_property_initialization' => true,
34
+        'no_superfluous_elseif' => true,
35
+        'no_unreachable_default_argument_value' => true,
36
+        'no_useless_else' => true,
37
+        'no_useless_return' => true,
38
+        'ordered_class_elements' => true,
39
+        'ordered_imports' => true,
40
+        'php_unit_strict' => true,
41
+        'phpdoc_add_missing_param_annotation' => true,
42
+        'phpdoc_order' => true,
43
+        'phpdoc_types_order' => [
44
+            'null_adjustment' => 'always_last',
45
+            'sort_algorithm' => 'none',
46
+        ],
47
+        'strict_comparison' => true,
48
+        'strict_param' => true,
49
+        // Remove when https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3222 has been merged
50
+        'LeoFeyer/optimize_native_functions' => true,
51
+    ])
52
+    ->registerCustomFixers([
53
+        new LeoFeyer\PhpCsFixer\OptimizeNativeFunctionsFixer()
54
+    ])
55
+    ->setFinder($finder)
56
+    ->setRiskyAllowed(true)
57
+    ->setUsingCache(false)
58
+;