File tree 3 files changed +35
-0
lines changed
tests/Integration/Fixtures
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 136
136
use PhpCsFixer \Fixer \Semicolon \SpaceAfterSemicolonFixer ;
137
137
use PhpCsFixer \Fixer \Strict \DeclareStrictTypesFixer ;
138
138
use PhpCsFixer \Fixer \Strict \StrictParamFixer ;
139
+ use PhpCsFixer \Fixer \StringNotation \MultilineStringToHeredocFixer ;
139
140
use PhpCsFixer \Fixer \StringNotation \SingleQuoteFixer ;
140
141
use PhpCsFixer \Fixer \Whitespace \ArrayIndentationFixer ;
141
142
use PhpCsFixer \Fixer \Whitespace \BlankLineBeforeStatementFixer ;
383
384
DeclareStrictTypesFixer::class,
384
385
// Functions should be used with `$strict` param set to `true`
385
386
StrictParamFixer::class,
387
+ // Convert multiline string to heredoc or nowdoc.
388
+ MultilineStringToHeredocFixer::class,
386
389
// Convert double quotes to single quotes for simple strings
387
390
SingleQuoteFixer::class,
388
391
// Each element of an array must be indented exactly once.
Original file line number Diff line number Diff line change @@ -61,6 +61,23 @@ class Basic extends AbstractBasic implements InterfaceFromThisNamespace // Fully
61
61
$ baz = implode (', ' , ['foo ' , 'bar ' ]);
62
62
}
63
63
64
+ // HeredocIndentationFixer
65
+ $ heredoc = <<<HEREDOC
66
+ This is a
67
+ multiline heredoc string. It contains $ foo.
68
+ It should be indented, though.
69
+ HEREDOC ;
70
+ // HeredocIndentationFixer
71
+ $ newdoc = <<<'NEWDOC'
72
+ This is a $newdoc, where variables are not expanded.
73
+ NEWDOC;
74
+ // MultilineStringToHeredocFixer
75
+ $ multilineString = <<<'EOD'
76
+ This string
77
+ spans multiple lines
78
+ but should be heredoc instead
79
+ EOD;
80
+
64
81
// SingleLineCommentSpacingFixer
65
82
// This comment should have space on the beginning
66
83
/* So should this one, also with space on the end */
Original file line number Diff line number Diff line change @@ -53,6 +53,21 @@ class Basic extends \Some\Other\Namespace\AbstractBasic implements \Lmc\CodingSt
53
53
$ baz = join (', ' , ['foo ' , 'bar ' ]);
54
54
}
55
55
56
+ // HeredocIndentationFixer
57
+ $ heredoc = <<<HEREDOC
58
+ This is a
59
+ multiline heredoc string. It contains $ foo.
60
+ It should be indented, though.
61
+ HEREDOC ;
62
+ // HeredocIndentationFixer
63
+ $ newdoc = <<<'NEWDOC'
64
+ This is a $newdoc, where variables are not expanded.
65
+ NEWDOC;
66
+ // MultilineStringToHeredocFixer
67
+ $ multilineString = 'This string
68
+ spans multiple lines
69
+ but should be heredoc instead ' ;
70
+
56
71
// SingleLineCommentSpacingFixer
57
72
//This comment should have space on the beginning
58
73
/*So should this one, also with space on the end*/
You can’t perform that action at this time.
0 commit comments