File tree 3 files changed +24
-2
lines changed
tests/Integration/Fixtures
3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 68
68
use PhpCsFixer \Fixer \FunctionNotation \CombineNestedDirnameFixer ;
69
69
use PhpCsFixer \Fixer \FunctionNotation \FopenFlagOrderFixer ;
70
70
use PhpCsFixer \Fixer \FunctionNotation \FopenFlagsFixer ;
71
+ use PhpCsFixer \Fixer \FunctionNotation \FunctionDeclarationFixer ;
71
72
use PhpCsFixer \Fixer \FunctionNotation \ImplodeCallFixer ;
72
73
use PhpCsFixer \Fixer \FunctionNotation \LambdaNotUsedImportFixer ;
73
74
use PhpCsFixer \Fixer \FunctionNotation \NoUnreachableDefaultArgumentValueFixer ;
541
542
],
542
543
],
543
544
)
545
+ // Spaces should be properly placed in a function declaration.
546
+ ->withConfiguredRule (
547
+ FunctionDeclarationFixer::class,
548
+ ['closure_fn_spacing ' => 'none ' ], // Defined in PER 2.0
549
+ )
544
550
->withSkip ([
545
551
// We allow empty catch statements (but they must have comment - see EmptyCatchCommentSniff)
546
552
EmptyStatementSniff::class . '.DetectedCatch ' => null ,
Original file line number Diff line number Diff line change @@ -38,8 +38,16 @@ class Basic
38
38
return false ; // BlankLineBeforeStatementFixer
39
39
}
40
40
41
- public function fooBar (mixed $ foo ): mixed
41
+ public function fooBar (mixed $ foo ): mixed // FunctionDeclarationFixer
42
42
{
43
+ $ value = 5 ;
44
+ // FunctionDeclarationFixer
45
+ $ function = function ($ foo ) use ($ value ) {
46
+ return $ foo + $ value ;
47
+ };
48
+ // FunctionDeclarationFixer
49
+ $ fn = fn ($ foo ) => $ foo + $ value ;
50
+
43
51
// PhpdocToCommentFixer
44
52
/*
45
53
* Phpdoc used instead of plain comment
Original file line number Diff line number Diff line change @@ -31,8 +31,16 @@ class Basic
31
31
32
32
public const MY_PUBLIC_CONST = 333 ; // OrderedClassElementsFixer
33
33
34
- public function fooBar ( mixed $ foo ): mixed
34
+ public function fooBar ( mixed $ foo ): mixed // FunctionDeclarationFixer
35
35
{
36
+ $ value = 5 ;
37
+ // FunctionDeclarationFixer
38
+ $ function = function ($ foo )use ($ value ) {
39
+ return $ foo + $ value ;
40
+ };
41
+ // FunctionDeclarationFixer
42
+ $ fn = fn ($ foo ) => $ foo + $ value ;
43
+
36
44
// PhpdocToCommentFixer
37
45
/**
38
46
* Phpdoc used instead of plain comment
You can’t perform that action at this time.
0 commit comments